Page 1 of 1

FINDSTR: how to only display the searched strings?

Posted: 14 Nov 2011 01:46
by tinfanide
I've an xml file and needa do batch renaming of the pic paths
<gallery>
<pic path="images/folder 1/pic 009.JPG" desc="desc 1" />
<pic path="images/folder 1/pic 010.JPG" desc="desc 2" />
</gallery>


I want to only replace " " with "_" within the path attribute.
I can hardly find any switches of FINDSTR to do that.

Code: Select all

FINDSTR path= testtxt.txt

Re: FINDSTR: how to only display the searched strings?

Posted: 10 Jan 2013 04:47
by ppalkar
Try

FINDSTR "\<string\>" "path of file"

findstr \c:"string" "path of file"

i think this would work and solve your purpose. let me know if in case it doesn't work.

plz specify the full path of the file. :)

Re: FINDSTR: how to only display the searched strings?

Posted: 10 Jan 2013 05:01
by foxidrive
That is a 2 year old post.

Re: FINDSTR: how to only display the searched strings?

Posted: 10 Jan 2013 11:31
by Ocalabob
foxidrive wrote:That is a 2 year old post.

No worries mate, type TARDIS /? at a command prompt. :D

Re: FINDSTR: how to only display the searched strings?

Posted: 11 Jan 2013 02:51
by foxidrive
Ocalabob wrote:
foxidrive wrote:That is a 2 year old post.

No worries mate, type TARDIS /? at a command prompt. :D


It tells me that I need K9.exe installed. :)

Re: FINDSTR: how to only display the searched strings?

Posted: 16 Jan 2013 00:17
by gkolarkar
Doctor Who is everywhere ! Whizzes the Sonic Screwdriver :D