• 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: Thu, 22 Jul 2010 11:33:43 +0100

On 22 Jul 2010, at 10:32, Tommy Bollman wrote:

I'm only curious of why it is necessary to have that last space included, I'm just wondering why:

set sorted_file to do shell script ("tr -d \\\" < " & posix_path_to_csv & " | sort -n -t , -k " & column_id & " ")

There's no reason. The actual reason it's there is because the original version of the script was

 do shell script ("sort -n -t , -k " & column_id & " " & posix_path_to_csv)

I then cut and pasted '& posix_path_to_csv' to use with tr -

do shell script ("tr -d \\\" < " & posix_path_to_csv & " | sort -n -t , -k " & column_id & " ")

Leaving behind & " ". Lazy programmer :-)

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

References: 
 >Sort Array by Column X (From: Richard Lake <email@hidden>)
 >Re: Sort Array by Column X (From: Steve Thompson <email@hidden>)
 >Re: Sort Array by Column X (From: Richard Lake <email@hidden>)
 >Re: Sort Array by Column X (From: Steve Thompson <email@hidden>)
 >Re: Sort Array by Column X (From: Richard Lake <email@hidden>)
 >Re: Sort Array by Column X (From: Steve Thompson <email@hidden>)
 >Re: Sort Array by Column X (From: Tommy Bollman <email@hidden>)

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