Re: Remove Final C/R?
Re: Remove Final C/R?
- Subject: Re: Remove Final C/R?
- From: John Delacour <email@hidden>
- Date: Mon, 1 Sep 2003 21:21:25 +0100
- Mac-eudora-version: 6.1a1
At 11:48 am -0700 1/9/03, Marconi wrote:
Given the full path to a text file, I need to simply remove the new
line after the last line, i.e., the carriage return at the very end
of the file. I can't figure out how...
set fU to "/tmp/f"
set f to fU as POSIX file as file specification
open for access f with write permission
set eof f to 0
write "Ah!" & return to f -- <<<<<<<<
close access f
open for access f with write permission
set n to get eof f
set s to read f for n - 1 -- <<<<<<<<
close access f
s
JD
.
_______________________________________________
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.