in reply to Re^3: replace string from Command Line (updated)
in thread replace string from Command Line

I have more than 75 scripts which need to be replaced and compatible to DVT. ... I thought I could do this from the command line
This sounds like more than just a quick-and-dirty, one-off command-line task. Write yourself a script. Put all the filenames to be processed into a file and pass that filename to your script. Open each file, make a verified backup first, make all changes (and there will probably be others you need to do; these can easily be added to your script), then save the altered file. Only process files that are copies of files saved elsewhere!

I'd like to provide a pseudo-script example, but I don't have time ATM. Maybe later if no one else steps in first. Just remember that the \Q...\E approach fails if there is any variation in spacing in the substrings to be altered or if they are broken over multiple lines. In that case, a broader approach is needed, but can easily be integrated into a general script.


Give a man a fish:  <%-{-{-{-<