Re: Setting contents of a large file to a variable.
Re: Setting contents of a large file to a variable.
- Subject: Re: Setting contents of a large file to a variable.
- From: Dan Belfiori <email@hidden>
- Date: Thu, 25 Nov 2004 06:55:16 -0800
On Nov 25, 2004, at 12:36 AM, Rob Stott wrote:
The easiest change to your existing script would be to process the
file in
chunks.
Andrew's method works and is the way most folks get round this in
AppleScript. Depending on what you want to do, it may also be worth
your while investigating how to use 'do shell script' to manipulate a
text file (read up on Unix commands, cat, grep, tr and sed).
The advantage of shell scripts is that you edit the text file instead
of trying to read, edit and rewrite it. I know very little of unix
commands...but this one did it for me.
perl -pi -e s/OldText/NewText/g file.txt
It uses perl to find and replace text in a text file. It took some
experimenting to get the above command formuated into a applescript
string variable so it would succeed as a shell script.
-db
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden