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: 1501
Type: Count and statistics   
Search all Count and statistics examples
Description:
How to count the number of lines under each specified pattern?
Input Sample:
lesn1 quiz 

     7.00/14.00 

      8.00/14.00 

      9.00/14.00 

      13.00/14.00 

      0.00/14.00 

lesn2 quiz  

     10.00/15.00 

      12.00/15.00 

Output Sample:
lesn1 quiz 
5
lesn2 quiz  
2
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 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!

Note: 
* 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 count the number of ip addresses from each country? (65%)
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%)
How to change the order of lines according to specified position? (63%)
How to convert numbers into scientific format with specified spacing? (63%)

Check Demo of Count and statistics
Keywords:
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