Remove the data

Hi team,
We have docs file i want to remove the USD RATE column value (45.00) value its a dynamic for all pages please give the solution.
we have attached
test.zip (63.8 KB)
file for reference

1 Like

Hi @AsadPathan2665

In Word Application Scope pass your .docx file path, use Read Text and save Output → out_Text

Then using regex replace number with nothing..
System.Text.RegularExpressions.Regex.Replace(out_Text, “(USD RATE[:\s]*)\d+(\.\d+)?”, “$1”, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
Sequence.xaml (8.6 KB)

After this you can write this text to new word or overwrite in the same word and you are done.

If helpful, mark as solution. Happy automation with UiPath

I want same word format after changes

We are not changing any format, you mean after you update using above method, there are issues ?

yes format changed
after Regex using write text file and provide docText variable.

Got it, it makes sense, what you are telling. Can you try find and replace activity inside word. This will maintain format as it is.

how we can use replace activity for removing the value in USD RATE column.
some time value will be chage its a dyanamic

Check this.


StudioX - Tutorial: Working With Word Automation

[Activities - Replace Text in Document]
(Activities - Replace Text in Document)

@AsadPathan2665

please follow the steps

  1. Read the data into string variable
  2. use regex to find the values to be replaced
  3. then use replace activity in work ..pass the indentified value in step 2 as input and replace it with any word you need
  4. repeat step 2 and 3 for all the value

cheers