Re: Sort Array by Column X
Re: Sort Array by Column X
- Subject: Re: Sort Array by Column X
- From: Steve Thompson <email@hidden>
- Date: Wed, 21 Jul 2010 11:17:54 +0100
On 21 Jul 2010, at 10:26, Richard Lake wrote: I have a CSV like the extract below that I have read into Applescript in as an array:
This is how I did something similar - I pre-process the CSV instead of sorting the array purely because it's faster. However, it's not much use if you need to sort the data by a different column at a later stage of your script
set sorted_file to do shell script ("sort -n -t , -k " & column_id & " " & posix_path_to_csv)
Just so you know, that's sort --numeric --use the next character as a separator , -sort this key"
Steve |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden