[OS X TeX] [OT] TextWrangler multiple file replace

Alan Munn amunn at gmx.com
Sat Jul 24 08:48:01 EDT 2010


On Jul 23, 2010, at 5:57 PM, Rob Rye wrote:

> Hi Alan,
>
> Your example below contains 3 \'s. So far as I can tell you have one  
> too many \'s in your replace string.

Sorry, that was a typo in my message.

>
> When I do essentially what you indicate you want to do using grep in  
> a multi-file search and replace in TextWrangler, but only have two \ 
> \'s (one to escape it in grep and the other to place the escape  
> character into the LaTeX document) in the replace string it works  
> just fine.

Independent of the replace string, I still get the same problem, that  
it can't find the search string even though in any individual file it  
can.

Weird.

Thanks anyway.

Alan


>
> My entries in the relevant fields in the TW GUI:
>
> Find: [&$%]
>
> Replace: \\&
>
> Cheers,
>
> Rob
> On Jul 23, 2010, at 12:10 PM, Alan Munn wrote:
>
>> Sorry this is only vaguely on topic.  I have a bunch of text files  
>> that I would like to do a global replace of the &,$, %  that need  
>> to be escaped in LaTeX.  If open one of the files, and do the  
>> following search using grep:
>>
>> [&$%]
>> replace with
>> \\\&
>>
>> It correctly finds instances of these characters and does the  
>> correct replacement.
>>
>> However, if I try the same search using the multi-file search,  
>> (also using grep) it returns with "The pattern [&$%] was not  
>> found.", yet I know there are instances in the files (since I can  
>> do the same search on any single file.)
>>
>> Can someone confirm this behaviour and/or tell me what I'm doing  
>> wrong?
>>
>> Thanks
>>
>> Alan
>>
>> -- 
>> Alan Munn
>> amunn at gmx.com
>>
>>
>>
>>
>> ----------- Please Consult the Following Before Posting -----------
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
>> List Archive: http://tug.org/pipermail/macostex-archives/
>> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
>> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>>
>
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex
>

-- 
Alan Munn
amunn at gmx.com







More information about the MacOSX-TeX mailing list