Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

966.Count and statistics -- How to count the number of lines under each specified pattern?

User: colin -- 2012-07-03          << 965  967 >>
Hits: 2760
Type: Count and statistics   
Search all Count and statistics examples
How to count the number of lines under each specified pattern?
Input Sample:
lesn1 quiz  
lesn2 quiz   
Output Sample:
lesn1 quiz  

lesn2 quiz   

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 text file to "Batch Runner" window 
3. click "Fast Replace" button 
4. click "Add" to add new rule 
* set "search" to: 
* set "replace" to: 
* click "ok" 
5. make sure "reg exp" option is check. 
6. click "start", done! 
* you need to make backup in advance to avoid original files being overwritten. 
* if you don't want to change original file, only want to generate an output, you can select "output to single file" in last step. 
* if there are other non related text in each file and you want to ignore them, you can check option of "extract" in step 5.

Screenshot 1:  Fast_Replace_Window

Similar Examples:
How to count the number of consecutive lines with specified pattern? (79%)
How to count the number of specified part in each line? (69%)
How to count the consecutive lines with the same pattern? (68%)
How to move strings matching specified patterns? (65%)
How to count the number of ip addresses from each country? (65%)
How to group text by specified number of lines and apply with specified format? (64%)
How to count the number of english words that has specified number of chars? (64%)
How to exchange line3 and line4 in 4-line-groups matching specified pattern? (63%)

Check Demo of Count and statistics
lines under  written  backup  non  output to single file  statistics  statist  count and statistics  ignore  ics  extract last lines  extract lines last  pattern count in text files  ignore lines  count in multiple files  extract specified lines  extract last  count number of lines