Re: search/replace on multiple files?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John McGhie (john_at_mcghie.name)
Date: 01/02/05


Date: Mon, 03 Jan 2005 09:27:32 +1100

Great pick-up, Bill :-)

I wish to point out that "All open documents" is a brand-new Macintosh only
feature of Word :-)

Others have referred you to the Wildcards find/replace. This is not "quite"
what a Unix pilot would describe as "regex" but it's close enough. You have
a maximum of nine levels of nesting within your expression, and I think it's
three pending operations within a statement.

I've never found I need any more. The problem with this sort of thing in
normal documents is that the variability of the content in the documents is
such that really hairy-chested regex find/replaces are simply not safe!
(Unless I wrote the documents, of course: then I know they will be totally
consistent... Not!)

Given the complexity of the syntax and the fact that I have to look it all
up every time I use it, I tend to record the syntax into a VBA Macro every
time I get it right. This is pretty simple: When you get one to work
correctly: turn on the macro recorder and then perform a Replace. It will
record the entire contents of the Find and Replace dialogs into the code for
you, so you have it stored for all time, and you can edit it as required.

Cheers

On 3/1/05 4:34 AM, in article BDFD7094.20A63%bill@nospam.net, "Bill Weylock"
<bill@nospam.net> wrote:

> News is better than you would expect (based on reading your endnotes thread).
> :) In fact, Word does a great job of this.
>
> You do have to have all the documents open.
>
> When you see the Replace dialog, click on the little blue arrow button to the
> left of the entry fields. That will give you the rest of the utility (which
> should be exposed as a default of course). Instead of the usual Current
> Document All, select łAll Open Documents.˛
>
> Works well and fast for me, although my documents do you have your length.
>
> You might want to check out a very inexpensive and gorgeously tended shareware
> text editor called Tex-Edit Plus. It will do normal expression searching.
>
>
> Best,
>
>
> - Bill
>
>
> On 1/2/05 4:50 AM, in article u6SBd.66145$Jk5.52836@lakeread01, "Ronald
> Florence" <ron@18james.com> wrote:
>
>> How do I do search/replace operations on multiple Word files, preferably
>> with both literal and regular expressions. As a simple example, how
>> would I replace "Zikhron" with "Zichron" in all the chapters of a ms.
>> I'm used to using grep, sed, awk, and/or perl for operations on multiple
>> files, but they only work with ascii files.
>>
>> I'm using Word-2004. Thanks,
>
>
>
>
> Panther 10.3.6
> Office 2004
> Windows XP Pro SP2
> Office 2003
>
>

-- 
Please reply to the newsgroup to maintain the thread.  Please do not email
me unless I ask you to.
John McGhie <john@mcghie.name>
Consultant Technical Writer
Sydney, Australia +61 4 1209 1410


Relevant Pages

  • Re: Combined Abbreviated contidionts (was: PIC P put to real use
    ... I sent Bill some questionable syntax off-list some time ago. ... I continue to use abbreviated conditions, and I continue to get bit by ... Anyway, no, I don't expect COBOL to change this at this stage. ...
    (comp.lang.cobol)
  • RE: Lost TOTAL Icon
    ... I don't want the syntax in the cell, I want the total, and only the total is ... "Bill" wrote: ... right click your tool bar and from the pop up, click customize. ...
    (microsoft.public.excel.misc)
  • Re: Trying Understand Formulas In Tables
    ... Tried it and I still got the error,!Syntax Error,*. ... "macropod" wrote: ... {REF HaulHours} ... Bill ...
    (microsoft.public.word.tables)
  • Converting Dataset to Recordset
    ... Bill wrote his demo in VB.NET. ... When incorporating his code in my C# app, the ADODB.Recordset Open method ... what syntax is used to open an ADODB Recordset from an XML ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: from the inside to outside
    ... How to run update query on AS400 table as linked server? ... Bill, As I indicated, I can't help in getting the syntax right for ...
    (comp.security.firewalls)