Text file change

Hi ,
How do insert specific words from one text file to another text file.
Ex: i have the information , now i need it FIND the exact words and make changes to a new text file .
*just find the words and make those changes

@Sira

you can read the first file for words

then read second file

loop on the values of first files and use replace function inside the loop

and once done write the data back to text file

cheers

1 Like

Can you please show me an example what you mean by loop

The values will vary each time

@Sira

say text 1 contains words you want to search with comma separation liek word1,word2,word3

now use for loop with str.split(","c) - this will ensure each word comes for each iteration in loop

then inside loop use strFinalData.Replace(currentitem,"Value to replace") - this will replaced the found word with value to replace

here str is the first file data and strFinalData is the last one

cheers

So even if the value will keep changing I can use this?

@Sira

yes the words can be anything

cheers

1 Like

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