Sorting field deliminated files (a la spreadsheet)

I have some comments to add to your advanced sorting examples.

I have a file
echo - "|field1|field2!field3!field4"field5 >sort-input
echo - "|fielda|fieldb!field1!fieldz"fieldx >>sort-input

And it would be useful to provide an example of the sort for the sort ordering based on
field 3, field 5 field 1

This is what I understant
sort -t deliminitor -k start, stop -k start, stop, -k start, stop is what I discovered.

To sort as I described
the command
is
sort -t’|’ -k3,3 -5,5 -k 1,1 sort.input -o sort.output

Please add this to the texmint

http://www.tecmint.com/sort-command-linux/ examples

1 Like

@lsatenstein

Its ‘tecmint’ not ‘texmint’, please correct it…