User: colin -- 2012-07-08 << 966 968 >> |
Hits: 3354 |
Type: Count and statistics |
Search all Count and statistics examples |
Description: |
How to count the number of consecutive lines with specified pattern? Need to replace each appearence of consecutive lines like format of "25.00/28.00" or "Unfinished" with the count of such lines. |
Input Sample: |
PAT 25.00/28.00 lesn1 5 views quiz1 7.00/14.00 8.00/14.00 9.00/14.00 13.00/14.00 0.00/14.00 lesn2 4 views quiz2 10.00/15.00 12.00/15.00 Unfinished lesn3 2 views |
Output Sample: |
PAT 1 lesn1 5 views quiz1 5 lesn2 4 views quiz2 3 lesn3 2 views |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. open "Tools->Batch Runner" menu 2. drag multiple files to "Batch Runner" window 3. click "Fast Replace" button to open "Fast Replace" dialog 4. click "add" to add new rules * set 'search' to: * set 'replace' to: * click "ok" 5. make sure "reg exp" and "cross line" are selected 6. click "start", done. |
Screenshot 1: Fast_Replace_Window |