Re: Sorting IP addresses
Re: Sorting IP addresses
- Subject: Re: Sorting IP addresses
- From: Emmanuel <email@hidden>
- Date: Sat, 20 Dec 2003 18:05:08 +0100
At 12:23 AM +0800 21/12/03, Bill wrote:
>
Marconi,
>
>
An alternative: using the shell command "sort".
>
>
Suppose a file records IP addresses, each in a new paragraph, with unix line ending, then you may try this one:
>
>
-- choose the file
>
set tmpPOSIX to quoted form of POSIX path of (choose file)
>
-- brief explanation: using . as field seperator, sort field 0-3 numerically
>
-- the first field is field 0, output the result to a file named "sortedIP.txt" on your desktop
>
do shell script "sort -t. +0n +1n +2n +3n " & tmpPOSIX & " > ~/Desktop/sortedIP.txt"
And you say that only now? :-)
Thanks for that one!
Emmanuel
_______________________________________________
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.