Batch Replace

General discussions about Advanced Find and Replace
Post Reply
Jason
Posts: 2
Joined: Tue Jul 24, 2007 3:19 pm

Batch Replace

Post by Jason »

Hi,

I have a text file and in that file I would like to do the following;

replace,
Table 1 with Jones J.
Table 2 with Jack K.
Table 3 with Jimmy A.
.
.
.
Table 10 with Sue B.
...

I created a csv file using M$ Excel and stored the replacement information there. I then imported the file into AFR and proceeded to execute the operation. The operation works fine up until Table 10 where Table 10 is replace with Jones J.1 and not Sue B. I have tried solving the problem using regular expressions but can't seem to figure it out(... in other words, I am looking for a regular expression that will find an exact phrase and not a subsection of that phrase). Can you please help me out with this problem?

Your cooperation will be deeply appreciated. Thanks.

Regards,
Jason.

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

Re: Batch Replace

Post by Abacre »

In search for part after Table 1 you usually have a space.
In terms on regular expressions space is \s

For try to use:
Search for:
Table 1\s

and for 10th table:
Search for:
Table 10\s

Or you may simply put space after Table 1 and after Table 10
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Jason
Posts: 2
Joined: Tue Jul 24, 2007 3:19 pm

Re: Batch Replace

Post by Jason »

Thanks for the reply. I appreciate very much. However there is no space after Table 1 or Table 10 in the text file. Actually, it is a XML file and Table 1 and Table 10 are enclosed in quotation marks, e.g.,

<Worksheet ss:Name="Table 1">
<Worksheet ss:Name="Table 2">
.
.
.
<Worksheet ss:Name="Table 10">

How do you propose that I solve this issue?

Thanks.

Rgds,
Jason.

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

Re: Batch Replace

Post by Abacre »

For example:

Code: Select all

Search for: Table 1">
Replace with: Jones J.">
In this case you don't even need to use regular expressions.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

Post Reply