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: 550
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 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 remove/delete the text from the '#' to the end in each line? (63%)
How to remove the text from line start to the first ":" in each line? (62%)
How to sort the text by the number of specific word in each line? (61%)

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