Page 1 of 1

Find and Replace text in files

Posted: Fri Feb 11, 2005 2:29 pm
by David.Marsh
How do I loop through a group of files and replace a key bit of text with another piece of text.

I want to loop through a list of files looking for "MYVARIABLE" text and replace it with a variable I have set in my RoboTask.

WHat is the easiest way to do this.

Find and Replace text in files

Posted: Mon Feb 14, 2005 5:02 am
by Oleg
You can do it by following algorithm:

File loop by mask
   Text loop on each file
      Replace desired text on each line
      and write new line into new file
   end text loop
   rename new file to old name
end file loop

File Loop and Text loop are RoboTask actions, but string replacement you need do in BASIC script.
I think that it is better to do all processing of single file in BASIC.