Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

689.Text sort -- How to sort a text file by the length of text in each line?

User: editor -- 2011-01-03          << 688  690 >>
Hits: 2905
Type: Text sort   
Search all Text sort examples
Description:
How to sort a text file by the length of text in each line?
Input Sample:
AAAA
BBB
CCCCC
DD
E
Output Sample:
E
DD
BBB
AAAA
CCCCC
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file
2. ctrl-h open 'replace' window
* set 'replace with pattern' to:

3. click 'replace', done!
4. ctrl-s save to file.

Note: version 2.6 or newer is required for function sort_by_func.

Screenshot 1:  Replace_Window


Similar Examples:
How to sort the text file by the date at the beginning of each line? (76%)
How to limit a text file to less than 40 chars each line? (71%)
How to split a text file according to first word in each line? (67%)
How to split a text file to different files according to first word in each line? (65%)
How to sort file by the number which first appear in each line? (65%)
How to split a text file to different files according to first word in each line? (65%)
How to join all text file in a folder and remove all blank lines? (63%)
How to remove/delete the text from the '#' to the end in each line? (63%)

Check Demo of Text sort
Keywords:
length  function  text sort  version  rsi  sort  new  each line  num  save  sort file by line length  sort the line by length in text file  sort line length  sort text file by line length  sort text by line length  text file sort by line length  sort text file line length  sort a text file by line length