*** MGsort.exe - Sort a text file (c) Markus Gnam 2017. Version 1.0.3.0 20171019 USAGE: MGsort [sort field] ... [option] ... SIMPLEST CALL, SORTING THE WHOLE LINE: MGsort Default sort order is alpabetic sorting using ASCII collating sequence. SORT FIELD: can be sorted either as String (/S) or as Field (/F). 1. String (/S): /S=P,L => string from position P with length L (L can be ommited, this means sorting until the end of the line from P. If no /S is submitted, the whole line will be sorted. /S=P,L can be repeated to submit a concatenated sort string) 2. Field (/F): [/T] /F=P,L Field F with given field number (separated with sign after /T) If no /T is submitted, this means default separator is "\t" (tabulator) (L can be ommited, this means sorting until the end of the field from P. =P,L can be ommited, this means sorting just the whole field. /F=P,L can be repeated to submit a concatenated sort string) Further specifications of the sort field, f.e. /S=12,19:n or /F1:b:i Specification appended with ":" directly after the sort field. Append :n after the sort field in order to sort numerically Append :b after the sort field in order to ignore leading/trailing blanks Append :c after the sort field in order to ignore case (letters [A-Za-z]) Append :c=u after the sort field to ignore case and umlauts (ANSI) Append :c=uDOS after the sort field to ignore case and umlauts (DOS) Append :i after the sort field in order to ignore case and accents (ANSI) Append :i=d after the sort field to ignore case and accents (DOS CP 850) Append :i=d437 after the sort field to ignore case and accents (DOS CP 437) Append :l after the sort field to sort letters [A-Za-z] after other letters GENERAL OPTIONS: can be appended before (or after) the sort fields. The general options are valid for all sort fields. /N Sort all sort fields numerically /B Ignore leading/trailing blanks in all sort fields /C Case insensitive (Ignore case for the letters [A-Za-z]) /C=u Case insensitive: Ignore case (letters [A-Za-z] and umlauts) (ANSI) /C=uDOS Case insensitive: Ignore case (letters [A-Za-z] and umlauts) (DOS) /I Ignore case and diacritic marks, break up umlauts and sharp S (ANSI) /I=d Ignore case and diacritics, break up umlauts and sharp S (DOS CP 850) /I=d437 Ignore case, diacritics, break up umlauts and sharp S (DOS CP 437) /L Lines starting with letters [A-Za-z] will be sorted after other letters /H=n Don't sort n header lines (default: n=0) /D Ignore records with duplicate keys (according to sort fields) /D=noSort Ignore records with duplicate keys, keep original order /D= Ignore records with duplicate keys, write them to /M=n Use n megabytes as maximal size for temporary files (default: n=250) /W=n Use Windows temp path for temp files (1, default) or current dir (0) /V=n Verbosity level of screen output (default yes: n=1 or silent no: n=0) EXAMPLES: :: example1.cmd: Sort tab sep. file with one header row by the 1st field: MGsort /H=1 /F1 names.txt names.sor :: example2.cmd: Sort this file with header by the 6th, then the 2nd field: MGsort /H=1 /F6 /F2 names.txt names.sor :: example3.cmd: Sort this file with header by the 10th field numerically: MGsort /H=1 /F10:n names.txt names.sor