Re: Reversing the lines in a file
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.