1.

Solve : Replacing single lines in files?

Answer»

is it possible to use findstr to get a line is a file. then REPLACE that line with and edited line?
like:
Code: [Select]findstr "line that i want to find" file.txt | replace "line that i want to find" "new line" file.txt
is there something like this?
Quote from: BatchFileBasics on May 24, 2009, 09:38:01 PM

is it possible to use findstr to get a line is a file. then replace that line with and edited line?
like:
Code: [Select]findstr "line that i want to find" file.txt | replace "line that i want to find" "new line" file.txt
is there something like this?

findstr is not the tool to edit files. See here for few examples i gave to replace TEXT in files. if you want to try the vbscript, do some changes
Code: [Select].....
strLine = objFile.ReadLine
strLine=Replace(strLine,"SEARCH","replace")
wscript.Echo strLine
.......
ahh.
thank you very much. it took a LITTLE bit for me to COMPLETELY understand but now i know.
Thank you very much gh0std0g


Discussion

No Comment Found