I always struggle with the Unix sort command. I have a file with many (100+) comma separated fields. I want to sort it first by field 43, then by field 15. I've tried each of these & none of them works (sometimes it seems as though they do but when I look at the data more closely I see errors).
sort -t , +43 +15
sort -t , -k 43,15
sort -t , -k 43 -k 15
Field 43 will have values like this:
HOME
PP190050
PP190230
PP410001
PP31C006NS
PP31C007
Field 15 is always 8 numerics beginning with 3 zeros, e.g.:
00021946
00030935
00021254
Can anyone help?
sort -t , +43 +15
sort -t , -k 43,15
sort -t , -k 43 -k 15
Field 43 will have values like this:
HOME
PP190050
PP190230
PP410001
PP31C006NS
PP31C007
Field 15 is always 8 numerics beginning with 3 zeros, e.g.:
00021946
00030935
00021254
Can anyone help?