Replace Pioneer Home
All Examples
Free Download
all
Advanced search and replace
Replace text in multiple files
Regular expression replace
Batch file rename
Batch download
Text file parser
Text file splitter
Html text generator
Search replace binary
Random word generator
Count and statistics
Character encoding
Bin Hex Oct Dec converter
Text generator
Text sort
Text merge
Text data calculation
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:
sort_by_func($match,'length','num')
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