Re: 'sort' command-alternative?
Re: 'sort' command-alternative?
- Subject: Re: 'sort' command-alternative?
- From: John W Baxter <email@hidden>
- Date: Sun, 6 Oct 2002 13:07:55 -0700
At 21:20 +1000 10/6/2002, Shane Stanley wrote:
>
At it's simplest: Lots of apps return results as type Unicode text. What
>
happens if I throw that at these Unix utilities, or do I have to coerce them
>
to something else first? IOW, what do I have to do before I can use them.
>
>
Ditto for plain text that really isn't. And will the sorting order for
>
things like accented caps match that used by the Mac's old sort routines?
Sort believes its input is a stream of bytes, separated by Unix newline
characters into lines, and behaves accordingly. Look at the stream of
bytes, and you'll be able to work out what sort will do.
Hint:
Unix hexdump
displays its input as hex characters. If you get your data into a file,
this can help. Try the -C flag to hexdump, which may help if you don't
read ASCII represented in hex as your first language:
$hexdump -C atest.txt
00000000 00 64 00 65 00 6c 00 74 00 61 00 0a 00 61 00 62 |.d.e.l.t.a...a.b|
00000010 00 6c 00 65 00 0a 00 64 00 ea 00 6c 00 74 00 61 |.l.e...d...l.t.a|
00000020 00 0a 00 62 00 61 00 6b 00 65 00 72 00 0a 00 66 |...b.a.k.e.r...f|
00000030 00 6f 00 78 00 74 00 72 00 6f 00 74 00 0a 00 63 |.o.x.t.r.o.t...c|
00000040 00 68 00 61 00 72 00 6c 00 69 00 65 00 0a 00 64 |.h.a.r.l.i.e...d|
00000050 00 e9 00 6c 00 74 00 61 00 0a |...l.t.a..|
0000005a
See man hexdump (of course) for various other tricks hexdump can perform.
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.