User: Verotiana -- 2016-02-22 << 1346 1348 >> |
Hits: 3005 |
Type: Count and statistics |
Search all Count and statistics examples |
Description: |
How to count the consecutive lines with the same sequence number (2nd column) and same 3rd column. Output the 2nd and 3rd column and the result. |
Input Sample: |
15:40.728,90, E, R, R, , , , , , , , , , , , 15:42.730,91, E, R, R, , , , , , , , , , , , 16:00.734,100, E, R, D, , , , , , , , , , , , 16:00.741,100, E, R, D, R, , , , , , , , , , , 15:43.089,99, F, R, E, , , , , , , , , , , , 15:43.109,99, F, R, E, , , , , , , , , , , , 15:43.163,99, F, R, E, R, , , , , , , , , , , 15:45.086,100, F, R, E, , , , , , , , , , , , 15:45.131,100, F, R, E, R, , , , , , , , , , , 15:47.089,101, F, R, E, , , , , , , , , , , , 15:47.118,101, F, R, E, D, , , , |
Output Sample: |
90 E 1 91 E 1 100 E 2 99 F 3 100 F 2 101 F 2 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
1. ctrl-o open text file 2. ctrl-h open 'replace' dialogue * set 'replace unit' to 'Paragraph' * set 'replace with pattern' to: * click 'settings' page: * set 'para start' to other: * set 'para end' to None 3. click 'replace', done. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Settings_Window |
Similar Examples: |
How to count the number of consecutive lines with specified pattern? (81%) How to count the number of lines under each specified pattern? (66%) How to merge consecutive lines that have the same first column? (64%) How to count the number of consecutive identical lines? (62%) How to eliminate consecutive return and spaces? (62%) How to remove consecutive duplicate words in multiple files? (57%) How to remove/delete consecutive duplicate lines in a text file? (57%) How to count how many lines starting with an "a" ? (55%) |
Check Demo of Count and statistics |
Keywords: |
3rd consecutive onsecutive previous 2nd cut sequence number non paragraph paragra count consecutive lines consecutive words sequence number text file replace text sequence number replace text to sequence number count start same column replace text number count |