Skip to main content
Question

text replacer with looping


boubcher
Contributor
Forum|alt.badge.img+11

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

ebygomm
Influencer
Forum|alt.badge.img+33
  • Influencer
  • November 20, 2018

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


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • November 20, 2018

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?


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • November 21, 2018

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings