• 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: FindReplace by list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >FindReplace by list (From: Michel Raj <email@hidden>)

  • Prev by Date: FindReplace by list
  • Next by Date: Re: FindReplace by list
  • Previous by thread: FindReplace by list
  • Next by thread: Re: FindReplace by list
  • Index(es):
    • Date
    • Thread