Replace multiples words in text file

Hi Everyone!
I have a text file, and the requirement is to replace both the name and ticket number one by one. How can I automate this process? Can anyone provide any clues or suggestions?

By using regex you can replace

For Name

1.System.text.regularexpression.regex.replace(str_Text, “Name”, " Replacing_value")

For TicketNumber

2.System.text.regularexpression.regex.replace(str_Text, “TicketNumber”, " Replacing_value")

Or both can remove at single time

System.text.regularexpression.regex.replace(str_Text, “TicketNumber”, " Replacing_value"). replace(str_Text, “TicketNumber”, " Replacing_value")

@Kumar_Sahu_Sameer

1 Like

Hi

Use read text file activity and get the output as a string named Strinput
Now use a assign activity like this

Strinput = Strinput.ToString.Replace(“_Name”,”your new word”).Replace(“TicketNumber”, “your new number”)

If you want to make it dynamic u can place a placeholder in those places in the text file

Refer this for more idea on that

Cheers @Kumar_Sahu_Sameer

1 Like

Both solutions are working as expected. Thank you all; you are awesome!

1 Like

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