Question

text replacer with looping

  • 20 November 2018
  • 3 replies
  • 3 views

Badge +10

Hello There

I have a text file where we have to replace word1 and word 2 with the one on excel by the one on this table, each time the 2 words are replaced we create a text file, after that, we move to next row replace the word and create a file

Any idea

 

word1word2bobinmaryinloulaoutwebout

 

Thanks


3 replies

Userlevel 1
Badge +21

Are you doing something similar to a mail merge here? From the information given, I don't think that there would be any requirement to loop

Userlevel 4
Badge +25

Can you explain in a little more detail? Do you mean you have an Excel spreadsheet where you want to replace "bob" with "in"? Or do you want to replace the words in this text file with ones from Excel?

Badge +10

Sure have a text file we need to search for word1 and word2 and replace them with the corresponding value and write it to a text file, at the end will have 4 text file

text file 1 will have word1=bob word 2=in

text file 2 will have word1=mary word 2=in

text file 3 will have word1=loula word2=out

text file 4 will have word1=web word2=out

 

the challenge is we don't know the number of rows in advance and we have to output text file for every row

Reply