Replace text in Word using Replace Text and Regex activity

Hello everyone, I need help with something, I have a word file in which I must replace all that word that starts with C and is followed by a number with an empty space.

I need to do it with the Replace text in Document activity so that I can preserve the format of the file

Hi @Juan_Esteban_Valencia ,

use word application scope inside the scope use Replace word from document replace the Character ā€œCā€ to ā€œā€


Happy automate

Hi @Juan_Esteban_Valencia

You can first get the data from word and then use

System.text.regularexpressions.regex.matches(your data," C\d+")

This will give you all the words matches.

Use a for loop on this and change type argument to System.text.regularexpressions.regex.match

Inside the loop use replace activity with each word and give the word and replace without the first characters using currentitem.substring(1)


Perfect, it worked. Thank you very much.

1 Like

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