Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1033.Count and statistics -- How to count and sort the occurrance of different lines?

User: Aaron -- 2012-12-14          << 1032  1034 >>
Hits: 1510
Type: Count and statistics   
Search all Count and statistics examples
Description:
Hello:

Is it possible to make a version of example 130 that deletes duplicate lines from a file AND saves those duplicate lines to another text file?

I would like to examine the duplicated lines to see which are most common and how many times they occur.

thanks
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
You can do it in 2 steps:
A. delete the duplicate lines and save result to file1(as example 130)
B. count the number of lines and save result to file2

You can use following procedure to finish step B:
1. ctrl-o open text file
2. open menu "Replace->Replace by template->Word Frequency Statistics->Count and sort frequency of all lines" 
3. click "ok", click "replace", done.
4. ctrl-s save result to file.

Similar Examples:
How to count and sort the occurrence of different numbers in a text file? (78%)
How to count and sort the frequency of each line? (68%)
How to count the number of occurrence of every double letters? (67%)
How to put a list of names in different rows into one line? (63%)
How to count the occurrance of specific pattern in each line of text file? (62%)
How to add in different sentences after the different lines? (60%)
How to replace the last occurance of 'old' in every line with 'new'? (59%)
How to replace an random occurrence of an word with an random line? (58%)

Check Demo of Count and statistics
Keywords:
sort frequency  count and sort frequency  frequency  word frequency statistics  word frequency  common  occurrance  duplicated  duplicate lines  times  duplicate another  sort to delete duplicate lines  how to sort and delete duplicate lines of a text file  delete duplicate lines sort  text file sort and delete  how to duplicate a file many times  count duplicate  count frequency of occurrance