Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

478.Text sort -- How to sort all the lines of a text file by order the multiple columns?

User: editor -- 2010-04-15          << 477  479 >>
Hits: 486
Type: Text sort   
Search all Text sort examples
Description:
How to sort all the lines of a text file by order the multiple columns?

I have a text file with key, MM-DD-YYYY formated date and other fields in each line, how to sort it by the order of date
Input Sample:
IOSDGH 08-22-2000 otherfields ....
IEWRTH 02-12-2010 otherfields ....
SDFDGB 03-15-1980 otherfields ....
IOSDFD 12-01-2002 otherfields ....
........
Output Sample:
SDFDGB 03-15-1980 otherfields ....
IOSDGH 08-22-2000 otherfields ....
IOSDFD 12-01-2002 otherfields ....
IEWRTH 02-12-2010 otherfields ....
........
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 dialog
* in 'Replace with pattern', enter:

3. click 'Replace', done!

Note: character bytes 11-12 is day, 8-9 is month, 14-17 is year.
Download Script:  scripts/478.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to sort the lines in a text files by the order of line length? (78%)
How to sort all the lines of a text file randomly? (72%)
How to sort lines of text file by comparing the sum of column1, 2 and 3? (69%)
How to sort each line of text by the order of reversed line? (65%)
How to findout all lines that contain specified words in multiple files? (65%)
How to remove all the lines that with odd line number for multiple files? (65%)
How to sort all lines of text by specified keyword? (64%)
How to sort all the lines by the order of date with format day-month-year? (62%)

Check Demo of Text sort
Keywords:
year  field  nth  key  bytes  columns  order  byte  text sort  date  how to replace text month  replace multiple key  how to replace bytes in text file  sort all lines  sort lines of text  sort text lines  replace bytes  how to replace bytes