Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

82.Count and statistics -- How to count and sort the frequency of each line?

User: editor -- 2008-05-11          << 81  83 >>
Hits: 607
Type: Count and statistics   
Search all Count and statistics examples
Description:
I have a text file, I want to count the occurrance number of each different line, and sort by frequency.
Input Sample:
aaaaaaa
bbb dd
ccccccccccc
ccccccccccc
ddddd
bbb dd
bbb dd
Output Sample:
bbb dd 3
ccccccccccc 2
aaaaaaa 1
ddddd 1
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
There is an integrated function in Replace Pioneer menu:
Tools->Replace->Replace by Template->Word Frequency Statistics->Count and sort frequency of all line.
1. Ctrl-o open the file.
2. Open the menu mentioned above.
3. Click 'OK'
4. Click 'Replace'

Note: you can change parameters in step 3 and step 4 if you have more dedicated requirement.

Similar Examples:
Can I count the frequency of each word in a text file? (68%)
How to count and sort the frequency of all words appeared in many text files? (65%)
How to count the frequency of numbers base on the value range? (65%)
How to extract text from 'start' to 'end' in each line? (64%)
How to add a semicolon at the end of each line? (63%)
How to add a <BR> at the end of each line? (62%)
Can I count the appearance frequency of each character in a text file? (61%)
How to count the number of ip addresses from each country? (60%)

Check Demo of Count and statistics
Keywords:
requirement  sort by frequency  sort frequency  word frequency statistics  word frequency  frequency  occurrance  dic  statist  statistics  sort and count each line  sort by frequency in a file  text sort by frequency  sort frequency count  count occurrance  count frequency  text sort count  count line