Find string

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Nigel1969edwards
Posts: 1
Joined: 12 Apr 2016 16:06

Find string

#1 Post by Nigel1969edwards » 12 Apr 2016 16:18

How do I find a string in a text file and set it to a variable in the batch file

aGerman
Expert
Posts: 4689
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Find string

#2 Post by aGerman » 13 Apr 2016 10:56

Nigel1969edwards wrote:How do I find a string in a text file and set it to a variable in the batch file

When I read your question I wondered what the batch file would be good for? Obviously you already know the string (otherwise you wouldn't know what you are searching in the text file). What am I missing?

Regards
aGerman

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: Find string

#3 Post by ShadowThief » 14 Apr 2016 01:13

aGerman wrote:
Nigel1969edwards wrote:How do I find a string in a text file and set it to a variable in the batch file

When I read your question I wondered what the batch file would be good for? Obviously you already know the string (otherwise you wouldn't know what you are searching in the text file). What am I missing?

Regards
aGerman

Perhaps he's looking for some sort of regex matching, like grep -o?

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

Re: Find string

#4 Post by foxidrive » 14 Apr 2016 13:49

The OP hasn't returned since he posted in almost two days - more likely to have been a student asking an assignment question on fifteen different tech forums. ;)

Post Reply