Search and select/replace string/line in cmd

March 31, 2011 at 03:49:15
Specs: Windows 7
Hi.
In cmd is it possible to search a string in text file with edlin's "s" attribute and set number of line as a definition with "set" command?
And is it possible to use more than one attribute in one line in edlin command like:
*sHello dHello
?
Thanks.

See More: Search and select/replace string/line in cmd

Report •


#1
March 31, 2011 at 18:08:29
Nope. CMD doesn't have edlin, nor does it have a native utility that accepts such syntax.

You could download a POSIX-like environment, like Cygwin, I suppose.

How To Ask Questions The Smart Way


Report •

#2
April 2, 2011 at 03:45:57
I'm writing a batch file which should be find a special string and then insert a new line before the line that contains the string searched.
Or should find a string and select the line that contains the string and then replace the whole line with a new line.
is there any way to do this with batch script?

Report •
Related Solutions


Ask Question