Replace text in Word Document

Good day Community,

I was wondering if there is a way I can replace text on this word document:

image

I want to replace the “Test” with “Done” but only for the first 2 lines only . It’s not in a table. I tried using replace text like this:

image

but it’s not replacing anything. I copied the line in word to put in that replace but nothing is happening.

Any help would be greatly appreciated. Thanks!

Hi @mimuh ,

The Space between x and Test may not be as same as you have specified. Maybe that is the reason it is not getting replaced.

However, Why don’t you use just use “Test” and Check if it replaces it ?

@mimuh If you want to replace text you need not to mention x. Just use Test and replace it with Done

Hello! yes I’ve tried that but it also replaces the Test on the last line beside z. I only need to replace the ones with x.

Hello! Yeah i was also thinking that but I copied the line from word document to the activity so I was assuming it was the same.
I’ve tried that but it also replaces the Test on the last line beside z. I only need to replace the ones with x.

@mimuh , Is it possible for you to provide this Document ? Maybe we would need to find the Length of Spaces between the two words using Regex and then use it in the Replace Text Activity.

@mimuh Try this uncheck replace all So that It will replace the first word that it found. Use replace text activity twice so that it will replaces the first two words of Test with done

Capture

In this case it will not replace the Test with Z character

1 Like

Hello again, wow thank i can’t believe i missed that haha! its working now if the x test is in the first part but for structure like this do you maybe have an idea how can i skip the first line

image