Re: Sort Array by Column X
Re: Sort Array by Column X
- Subject: Re: Sort Array by Column X
- From: Richard Lake <email@hidden>
- Date: Wed, 21 Jul 2010 11:42:40 +0100
Having trouble with this.. got a working example with "," as the separator?
On 21 Jul 2010, at 11:17, Steve Thompson wrote: 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
Richard Lake Marketing Manager Tel: 0800 158 3898 | Email: email@hidden
|
_______________________________________________
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