View Full Version : searching a file for a string and changing that string
19th April 2001, 01:49
searching a file for a string and changing that string....
can this be done? I asked this before and no one answered.
i would like to search for say C:\winamp\test\test and change it to %TargetDir%\test\test where %TargetDir% is the target dir (duh)
19th April 2001, 01:57
CopyFiles C:\Winamp\test\test\*.* %TargetDir%\test\test
Messy, but it should work.
19th April 2001, 03:07
I meant to search for a string of text in the file... your solution seems to be moving files themseleves.
19th April 2001, 03:10
I think what he means is inside a data file, he has a string that says "C:\Program Files\MyApp". But if the application is installed in another location, like "D:\MyApp", the prebuilt data file will be wrong. He is wondering if there is a command to to search-and-replace inside a file that you have extracted.
The short answer is no, it can't be done. But a better answer is that yes, you can do it *but* you will have to write a program that does this yourself. I have a search-and-repace program of my own which I use, its about 15kb and runs silently, but it is so heavily dependant on my datafile structure that it would be useless to anyone else. I have a feeling that most people will find it easier to create customized programs like this than to try to find a generic solution.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.