complex search and replaces (was Re: [OS X TeX] Support for AppleScript please)

Alan Curtis acurtis at ieee.org
Mon Dec 6 13:32:17 EST 2004


On Dec 6, 2004, at 1:01 PM, William F. Adams wrote:

> Maybe it's heretical, but I've been using a Windows tool 
> ``bkreplacem'' for this sort of thing of late.
>
> Is there anything like to it (free!?!) for Mac OS X?
>
>

You could try a perl one-liner in a Terminal window. For example

perl -p -e 's/original/replacement/g' *.tex

would replace all occurrences of 'original' with 'replacement' in all 
the files *.tex. The find and replace strings can be regular 
expressions and so this can be very powerful.

Alan




--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list