Replace similar string in just part of a line

General discussions about Advanced Find and Replace
Post Reply
Easy Victor
Posts: 1
Joined: Wed Apr 13, 2016 1:45 am

Replace similar string in just part of a line

Post by Easy Victor » Wed Apr 13, 2016 2:19 am

Hoping you can assist with a find/replace problem I am having. I have a short string that I want to replace in a tab delimited line (actually 100,000 lines!). But this string appears in another part of the line also (which I don't want to replace). Here is an example:

CURRENT: -0123ABNDC-025 ND 4 b
REQUIRED: -0123ABNDC-025 NEW DEPARTURE 4 b

similar to above:

CURRENT: -0123ABCND-025ND ND 4 b
REQUIRED: -0123ABCND-025ND NEW DEPARTURE 4 B

Essentially, I want to replace the instance of "ND" ONLY after the 1st tab (it would only appear in the first 2 tabs in any case) with "NEW DEPARTURE".

How do I get AFR to only look for the find after the first tab?

Many thanks in advance!

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Re: Replace similar string in just part of a line

Post by Abacre » Wed Apr 13, 2016 6:29 pm

Go to batch replace tab.
check Use regular expressions
search for:
^(.+)\tND\t
replace with:
$1\tNEW DEPARTURE\t
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests