FINDSTR: how to only display the searched strings?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tinfanide
Posts: 117
Joined: 05 Sep 2011 09:15

FINDSTR: how to only display the searched strings?

#1 Post by tinfanide » 14 Nov 2011 01:46

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

ppalkar
Posts: 2
Joined: 10 Jan 2013 04:30

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

#2 Post by ppalkar » 10 Jan 2013 04:47

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. :)

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#3 Post by foxidrive » 10 Jan 2013 05:01

That is a 2 year old post.

Ocalabob
Posts: 79
Joined: 24 Dec 2010 12:16
Location: Micanopy Florida

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

#4 Post by Ocalabob » 10 Jan 2013 11:31

foxidrive wrote:That is a 2 year old post.

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#5 Post by foxidrive » 11 Jan 2013 02:51

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. :)

gkolarkar
Posts: 1
Joined: 16 Jan 2013 00:12

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

#6 Post by gkolarkar » 16 Jan 2013 00:17

Doctor Who is everywhere ! Whizzes the Sonic Screwdriver :D

Post Reply