file read

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alcool9999
Posts: 4
Joined: 17 Sep 2009 09:05

file read

#1 Post by alcool9999 » 18 Sep 2009 02:39

hi i need to read a text file line by line and check each time if that line matches a variable.

jaffamuffin
Posts: 40
Joined: 25 Jan 2008 14:05

#2 Post by jaffamuffin » 18 Sep 2009 03:32

Code: Select all

for /f %%A IN (file.txt) DO (
 IF "%%A"=="value" ECHO MATCH
)

ghostmachine4
Posts: 319
Joined: 12 May 2006 01:13

Re: file read

#3 Post by ghostmachine4 » 20 Sep 2009 20:52

alcool9999 wrote:hi i need to read a text file line by line and check each time if that line matches a variable.

use findstr

Post Reply