Re: What is the most efficient/fastest Find & Replace technique?
Re: What is the most efficient/fastest Find & Replace technique?
- Subject: Re: What is the most efficient/fastest Find & Replace technique?
- From: David Hood <email@hidden>
- Date: Fri, 31 Jan 2003 19:54:48 +1300
Don't forget "tr" on the command line
I've used it for doing batch find/replaces on folders on text files,
turning millions of tab marks to line endings.
tell application "Finder"
set NotTabbed to make new folder at desktop with properties
{name:"NoTabs"}
set PosNoTab to POSIX path of (NotTabbed as alias)
set Startfolder to choose folder
set ListofTabbed to every document file of Startfolder
end tell
repeat with loopCount from 1 to number of items in ListofTabbed
set tabbedFile to item loopCount in ListofTabbed
set sameName to name of tabbedFile
set butcherME to POSIX path of (tabbedFile as alias)
set command to "tr '\\11' '\\015' <" & butcherME & " > " & PosNoTab &
sameName
tell application "Terminal"
do shell script command
end tell
end repeat
The full details of that project are at
http://www.otago.ac.nz/nzpg/caversham/files/CTP260402.pdf
Regards,
David hood
_______________________________________________
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.