Subject: Re: sort
To: Lars M Gustafsson <gumse@gyral.com>
From: Bruce Anderson <brucea@spacestar.net>
List: port-mac68k
Date: 07/10/2000 05:07:51
Tabs will be treated as whitespace.
There is no way to sort on \t exclusively with
the gnu sort in the NetBSD tree, so keep white-
space out of your fields or use fixed length
records or use a non whitespace field seperator
or use sed to replace \t with something else.
Makeup a worst case file to test with.
If you need help, post some example output.
cougar$ cat test.txt
field1 field two9 field4 field4
field2 field two5 field5 field1
field3 field two8 field8 field6
field4 field two4 field4 field7
field5 field two9 field9 field8
field6 field two6 field0 field9
field7 field two3 field1 field0
cougar$ sort -k 3d,3 -k 4d,4 <test.txt
field7 field two3 field1 field0
field4 field two4 field4 field7
field2 field two5 field5 field1
field6 field two6 field0 field9
field3 field two8 field8 field6
field1 field two9 field4 field4
field5 field two9 field9 field8
cougar$ sort -k 3d,3 -k 4dr,4 <test.txt
field7 field two3 field1 field0
field4 field two4 field4 field7
field2 field two5 field5 field1
field6 field two6 field0 field9
field3 field two8 field8 field6
field5 field two9 field9 field8
field1 field two9 field4 field4
cougar$ sort -k 3d,3 -k 4dr,4 <test.txt
field7 field two3 field1 field0
field4 field two4 field4 field7
field2 field two5 field5 field1
field6 field two6 field0 field9
field3 field two8 field8 field6
field5 field two9 field9 field8
field1 field two9 field4 field4
On Sun, Jul 9, 2000 6:16 PM, Lars M Gustafsson <mailto:gumse@gyral.com>
wrote:
>I am trying to sort a tab-separated textfile on column 3 with the "sort"
>command,
>but I can't get it to work, any sort wizzards out there ??
>
>Regards,
>L.
>
" Stamp out root login's . . . . su " --Bruce Anderson
This message was created and sent using Cyberdog 2.0, MacOS 8.6,
awk, find, sed, sendmail, sh, and NetBSD a free Multi-Platform OS.