Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

144.Count and statistics -- Can I make statistics of each lines, tell how many times the digit of '1' to '5' are appeared?

User: editor -- 2008-05-22          << 143  145 >>
Hits: 570
Type: Count and statistics   
Search all Count and statistics examples
Description:
Can I make statistics of each lines, tell how many times the digit of '1' to '5' are appeared?
Input Sample:
14793685
2586973
3692584
7894563
Output Sample:
14793685 4
2586973 3
3692584 4
7894563 3
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
It's pretty easy!
1. ctrl-o open source file. 
2. ctrl-h open 'Replace' dialog, 
in 'Replace' window,  
* set 'Replace Unit' to 'Line' 
* fill in 'Search for Pattern': 

* fill in 'Replace with Pattern':

3. click 'Replace'
Note: $match means the matched line itself£¬count($match,"[12345]") means calculate the appearance of '12345', \n means return.
Download Script:  scripts/144.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How can I replace the 3rd lines of many files to a fixed string? (46%)
How to sort each line of text by the order of reversed line? (45%)
How to replace the first 3 characters of each line to fixed characters and add 'a' at the end? (45%)
Can I change the word order of each line and add a comma as separator? (45%)
How to duplicate each line 5 times in a text file? (44%)
How to make a DOS batch file that can rename many swf files according to lists? (43%)
How to add some text after the 5th line for every file in a directory? (43%)
How to batch rename many directories all at once by adding a sequence number ahead? (43%)

Check Demo of Count and statistics
Keywords:
tel  123  times  return  calculate  digit  dig  match count  statist  statistics  calculate lines  line of  how to match  file line  match 1 2  line 1  how to 2  how to