• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sort Array by Column X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Sort Array by Column X
      • From: Richard Lake <email@hidden>
References: 
 >Sort Array by Column X (From: Richard Lake <email@hidden>)

  • Prev by Date: Re: Sort Array by Column X
  • Next by Date: Re: Sort Array by Column X
  • Previous by thread: Re: Sort Array by Column X
  • Next by thread: Re: Sort Array by Column X
  • Index(es):
    • Date
    • Thread