• 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: tab delimited data file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tab delimited data file


  • Subject: Re: tab delimited data file
  • From: John Delacour <email@hidden>
  • Date: Wed, 25 Jun 2003 22:45:45 +0100
  • Mac-eudora-version: 6.0a23

At 2:48 pm -0500 25/6/03, Rick Norman wrote:

That's great except for the fact that each data file is 1000 records with 35
fields in each record. In this example would I have to paste the data file
into the script?

No. In that case you read from a file as I suggested you would want to. Use the same routines, text item delimiters, list etc. as in the examples I gave but read your file to get the lines and write to another file:

set s to "Bob 10 July, 4
Ted 10 July, 4
Carol 09 July, 4
Alice 09 July, 4
John 09 July, 4
Jane 02 July, 4
Fred 02 July, 4
Jim 01 July, 4"
set _fin to "/tmp/readme"
set _fout to "/tmp/writeme"
set _finmac to _fin as POSIX file
set _foutmac to _fout as POSIX file
open for access _finmac with write permission
write s as Unicode text to _finmac
close access _finmac
--That's your original file created
open for access _finmac
open for access _foutmac with write permission
repeat
try
set _line to read _finmac until return -- OR ASCII CHARACTER 10 !!!!
--do things with _line -- <<<<<<<<<<<<<<<<<<
write _line to _foutmac
on error
beep
exit repeat
end try
end repeat
close access _finmac
close access _foutmac
read _foutmac
_______________________________________________
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: 
 >Re: tab delimited data file (From: Rick Norman <email@hidden>)

  • Prev by Date: Uniq fields [was: tab delimited data file]
  • Next by Date: Re: tab delimited data file
  • Previous by thread: Re: tab delimited data file
  • Next by thread: Re: tab delimited data file
  • Index(es):
    • Date
    • Thread