• 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
sort lines in TextWrangler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sort lines in TextWrangler


  • Subject: sort lines in TextWrangler
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 11 Nov 2012 11:20:17 +0100

Hello
I have a text file with about 90,000 lines so I assumed that it would be a good idea to use TextWrangler to sort the lines.

After reading the dictionary, I wrote :

set leDocument to (path to desktop as text) & "essai.txt"

tell application "TextWrangler"
activate
open leDocument
sort lines of text document 1 with sort ignoring leading space and replacing target
close text document 1 with saving
end tell

My understanding was that the output option [with replacing target]
would replace the document contents by the sorted one.
Alas it doesn’t.

I replaced my original code by this new one :

set leDocument to (path to desktop as text) & "essai.txt"

tell application "TextWrangler"
activate
open leDocument
sort lines of text document 1 with sort ignoring leading space --and replacing target
set text of text document 1 to result
close text document 1 with saving
end tell

With it, the document contain the sorted lines.
It's fine but I'm wondering what is the output option [with replacing target] really doing.

Yvan KOENIG (VALLAURIS, France) dimanche 11 novembre 2012 11:15:41


 _______________________________________________
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 lines in TextWrangler
      • From: Christopher Stone <email@hidden>
    • Re: sort lines in TextWrangler
      • From: Shane Stanley <email@hidden>
    • Re: sort lines in TextWrangler
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: Out of Control Aliases?
  • Next by Date: Re: sort lines in TextWrangler
  • Previous by thread: Re: error -1700
  • Next by thread: Re: sort lines in TextWrangler
  • Index(es):
    • Date
    • Thread