Re: FindReplace by list
Re: FindReplace by list
- Subject: Re: FindReplace by list
- From: André Renault <email@hidden>
- Date: Sat, 4 Dec 2010 07:46:33 -0500
Hi Michel
I wrote a CLI utility that's called snrm - Search'N'Replace (Modified by a friend). Would you like me to upload it?
Syntax is simple:
$ snrm pattern replacement file ...
I tested it on a text file and it works quickly. Setting up a loop in AppleScript would be simple. If you had a list of in/out records, like {{search:"bob", replace:"fred"}, {search:"joe", replace:"james"}}, you could use a snippet:
set fileToOperate to file "Macintosh HD:Users:Name:Desktop:TextFile.txt"
repeat with i in listOfSearchAndReplace
do shell script "/path/to/snrm " & i's search & space & i's replace & space & POSIX path of fileToOperate
end repeat
On Dec 4, 2010, at 6:26 AM, Michel Raj wrote:
> I'm looking for hints to make a multiple search replace on text docs (.doc or .rtf)
> Something similar to the FindReplaceByList script that comes with InDesign.
> Is there something existing already existing to do so ?
> Or are there tools ?
> If you just could hint me where or what to look for.
>
> TIA
> Michel Raj
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden