Команды SFK


    1        2        3        4        5        6        7        8        9        10    

Раздел 4. Text Processing - Обработка текста
addhead | addtail | count | difflines | filter | head | joinlines | linelen | load | ofilter | perline | printloop | replace | run | runloop | snapto | sort | strings | tail | xed | xex | xreplace |


Help:   Рус   |   Eng        Refer:   Рус   |   Eng  

Команда: sort

Sort text lines alphabetically

on the command line
with the free Swiss File Knife for Windows, Mac OS X and Linux.
sfk ... +sort

sort text lines, case insensitive by default.
requires a previous command producing text output.

options
   -case        case sensitive text comparison
   -rev[erse]   reverse sorting order
   -skiphead    first line is a table header,
                exclude this from sorting
   -head=n      keep first n lines unsorted

web reference
   http://stahlworks.com/sfk-sort

examples
   sfk filter csv.txt +sort
      print sorted contents of csv.txt
   sfk filter csv.txt +sort +view
      shows output with the dview GUI tool