Re: Sorting IP addresses - Progress
Re: Sorting IP addresses - Progress
- Subject: Re: Sorting IP addresses - Progress
- From: Deivy Petrescu <email@hidden>
- Date: Mon, 22 Dec 2003 12:32:41 -0500
At 12:04 PM +0800 12/22/03, Bill wrote:
In reality, the shell sort , i.e. "sort -n -t.
..." is the fastest method and I'd think also the
easiest to program.
The only caveat, the file has to have Unix ending, not Mac ending.
Deivy,
You may consider the shell command tr
tr '\r' '\n' < unsortedfile |sort -n -t '.' -k
1,1 -k 2,2 -k 3,3 -k 4,4 |tr '\n' '\r' >
sortedfile
Excellent.
Thanks Bill. However, the last part should only
be used *if* you want a Mac file not Unix. Which
might not be the case.
Some apps use Unix file endings not Mac. Script Editor is one.
--
Regards
Saudagues
Deivy
http://www.dicas.com
_______________________________________________
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.