Are you saying that your substitution works for one file but not for
many with argo?

Anyway, specifying ^M isn't very portable, so you probably want
\n instead.  Also, you can save yourself using  \/  everywhere by using

:s;pattern1;pattern2;ge

Using  \s*  or  \s\+  instead of entering literal tabs or spaces can
also save some headaches.

You may also be getting into some trouble using the \& branch syntax. 
It's tricky (I've rarely used it) and it isn't clear in your example
that it's being used correctly to "and" together the different pattern
segments.  I could be confusing some syntax related to nbsp, but I
don't think you want the \  if you want to match &nbsp literally.

Save some typing using \d\d\d\d  or \d\{4}  instead of [0-9]...


On 4/16/06, Mike Blonder <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I am unable to successfully use args & argdo to change many files for a
> specific pattern that spans 3 lines.  The files are .htm files.
>
> I have used set listchars=:tab>-,trail:- to reveal the tabs within the
> file and have included what I take to be precisely the pattern within
> the argdo statement:
>
> argdo %s/>------>------<\/tr>^M>------>------    <td valign="middle"
> height="22"><font size="1">\&nbsp;<img src="\/images\/arrowright.gif"
> border=0 alt="[0-9][0-9][0-9][0-9]">\&nbsp;<a
> href="\/What_is_New.htm">What's New?<\/a><\/font<\/td>^M//ge | update
>
> The [0-9][0-9][0-9][0-9] represents 4 digits that are in each iteration
> of the line but 4 digits that change from file to file.  The ^Ms are
> properly expresses with at <ctrl> V <ctrl> M sequences.
>
> Am I missing, perhaps an end of line character?
>
> Any suggestions on this would be appreciated as I will shortly have to
> change lots and lots of files for specific patterns spanning several
> lines, albeit with a unique sequence within the pattern that varies from
> file to file.
>
> Thanks
>
> Mike
>

Reply via email to