• 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: Remove Final C/R?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Remove Final C/R? (From: Marconi <email@hidden>)

  • Prev by Date: Applescript and characters accented in a path
  • Next by Date: Re: Remove Final C/R?
  • Previous by thread: Re: Remove Final C/R?
  • Next by thread: Re: Remove Final C/R?
  • Index(es):
    • Date
    • Thread