• 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: Reversing the lines in a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reversing the lines in a file


  • Subject: Re: Reversing the lines in a file
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 10 May 2002 07:15:09 -0400

set textInput to read file ((choose file) as text) as list using delimiter return
set fileRef to open for access file ((((path to the desktop) as text) & "Resultr") as text) with write permission
set AppleScript's text item delimiters to return
write ((the reverse of textInput) as text) to fileRef
close access fileRef

On Thursday, May 9, 2002, at 07:29 PM, Rice, Gary wrote:

I have a text file. Each line in the file ends with a <CR>. It is a large
file. I want to reverse the order of the file. That is, I want the last line
in the file to appear at the begining and the first line in the file to be
at the end.

Can I do this using AppleScript?


Thanks.


Gary
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


--
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Reversing the lines in a file[speed, stack overflow}
      • From: Cornwall <email@hidden>
References: 
 >Reversing the lines in a file (From: "Rice, Gary" <email@hidden>)

  • Prev by Date: setting rows and columns of applework spreadsheet
  • Next by Date: Os X and task scheduling
  • Previous by thread: Re: Reversing the lines in a file
  • Next by thread: Re: Reversing the lines in a file[speed, stack overflow}
  • Index(es):
    • Date
    • Thread