Find exact Match and replace the tex file

Hi Every one,

Can someone help me find the exact match and replace the text?

In my text document, I’ve below texts. I wanted to find an exact match the word (?PipinInstruction1) replace with “Hameed”
The same case for (
?PipinInstruction15) replaces with “Hello”.

When I try to replace I got the below error to refer to screenshot. Also, I tried to find the exact match with regex still it’s matching with all the cases, can someone help out with this.

Actually, I am in the data table, and (*?PipinInstruction1) each row the value will change.

*?PipinInstruction1 SOME TEXT
*?PipinInstruction19 SOME TEXT

HI @Shagoul_Hameed

Try this expression



Look into the XAML file
ReplaceText.xaml (6.0 KB)



Can you try the following expression?



Hi Gokul,

thanks for the response but still it’s replacing the below texts, it should not replace the below two as am replacing “Hameed” only for (?PipinInstruction1) not (?PipinInstruction15,*?PipinInstruction19 SOME TEXT)

*?PipinInstruction19 SOME TEXT

Hi Yoichi,

I got the below error when I use this expression.



The above expression returns string which is replaced target string to “Hammed”.
If you want to check the target string is contained in condition of IF activity, can you try IsMatch activity as the following?



dear all,

It’s not worked it’s replacing as “hameed” everywhere “*?PipinInstruction1” in the txt file.

Do we’ve any alternative solution?

Actually, the concept is, am running in a loop from the data table, for example, I’ve 4 rows each row I’ve found an exact match from column A and replaced with column B value.

However, the problem is when run 1st iteration it’s replaced correctly, with the above solution you shared. still, it’s replaced as “hameed” for ro3# & row#4.

ID Colum A Colum B
1 *?PipinInstruction1 Hameed
2 *?PipinInstruction1 SOME TEXT Shagoul
3 *?PipinInstruction15 RAJ
4 *?PipinInstruction19 SOME TEXT Gokul


For understanding your requirement correctly, can you share your input string and expected string? It’s better if you can share the above as file.



Row1 = *?PipinInstruction1 is my input output should be “Hameed”
Row3 = *?PipinInstruction15 is my input output should be “RAJ”

Book1.xlsx (9.8 KB)


Do you want to update the excel sheet? If so, the following will work. Can you try this? (9.8 KB)


Dear Yoichi

Thank you but I want to find and replace it on txt file not the excel file.

So I will check the value from excel and I read the text file and I found an exact match then I should replace in the text file


If possible, can you share your input text file and expected result text file? It’s no problem if dummy data.


Yes , sure… PFA…
txt.txt (112 Bytes)


Is this an input file? I’m glad if you can also share expected result text file.


Sure, Attaching both input and result text files.
REsult.txt (63 Bytes)
txt.txt (121 Bytes)


Thank you for sharing. Can you try the following?

Note: I modified master xlsx sheet as the following.

img20220324-5-1 (10.1 KB)


Dear, Yoichi

Thanks a ton :blush: this will help me a lot, thanks you so much for the support​:blush:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.