Page 1 of 1

Batch Replace

Posted: Tue Jul 24, 2007 3:34 pm
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.

Re: Batch Replace

Posted: Tue Jul 24, 2007 4:45 pm
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

Re: Batch Replace

Posted: Tue Jul 24, 2007 5:06 pm
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.

Re: Batch Replace

Posted: Tue Jul 24, 2007 5:30 pm
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.