• 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
reading and deleting lines from a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reading and deleting lines from a file


  • Subject: reading and deleting lines from a file
  • From: Michael Glasser <email@hidden>
  • Date: Thu, 21 Aug 2003 10:30:43 -0700
  • Resent-date: Thu, 21 Aug 2003 17:35:49 -0700
  • Resent-from: Michael Glasser <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: email@hidden

I am working on an AppleScript that, in part, needs to:
1) see if file "data" exist on desktop
2) if so, look to see if there is data in the file, if not, wait a couple seconds and try again
3) if there is data, read the first line and remove it from the data file
4) process the data...
5) return to step 1 (or maybe 2)

I have been tinkering for a while, but can not get my prog to read one line at a time (read paragraph 1 seems to read the whole file), nor can I get it to delete the text that is being processed.

The data file will be getting updated from elsewhere, which is why I need to keep checking...

If, for some reason, this is not possible, it would also be OK to read the whole file, delete all read lines, then process it one line at a time in a repeat loop... hmmm... that may be faster...

any ideas are appreciated.
_______________________________________________
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.

  • Prev by Date: Re: <no subject>
  • Next by Date: Re: <no subject>
  • Previous by thread: Re: UI Browser and gooey scripting ...
  • Next by thread: Re: reading and deleting lines from a file
  • Index(es):
    • Date
    • Thread