Find and Replace text in files

Discuss RoboTask here
Post Reply
David.Marsh
Posts: 11
Joined: Mon Aug 02, 2004 3:15 am

Find and Replace text in files

Post 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.
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Find and Replace text in files

Post 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.
Post Reply