[X-Unix] Help with BBEdit Grep find and replace

Rick Gordon rick at rickgordon.com
Fri Feb 1 11:48:32 PST 2008


In BBEdit, you can set the Find string to:

(LogFilePath.+cobra\\[^\\]+\\)([^\\]+)(\\.*\r(?:.+\r)+?)(LogFilePath2.+corvette\\[^\\]+\\)([^\\]+)\\


Set the Replace string to:

\1\2\3\4\2\\

Rick Gordon

------------------

On 1/31/08 at 4:32 PM -0500, Nick Scalise wrote in a message entitled
"[X-Unix] Help with BBEdit Grep find and replace":

>Hello,
>
>I posted to this list long ago about some help with grep and I am coming back to the well one more time as the help was excellent last time.
>
>I have some report files that need to be updated and the second line needs to be changed to be similar to the first line:
>
>ServerName=Cobra
>LogFilePath=file:///d:\webtrendslogs\cobra\E0182201\W3SVC1822\*.log
>LogFileUsername=
>LogFilePassword=
>ServerName2=Corvette
>LogFilePath2=file:///d:\Webtrendslogs\corvette\e0182201\W3SVC1823\*.log
>
>What I am looking for is the line that begins with LogFilePath2 to be made to be similar to the line that begins with LogFilePath. In the example above the only differences is the machine name (cobra/corvette and the w3svc182x)
>
>I want the w3svc182x number to change but not the machine name.
>
>I will be using BBEdit for this (version 8.7.2 (260))
>
>Can anyone provide assistance for me?
>

-- 
 
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com


More information about the X-Unix mailing list