View unanswered posts | View active topics It is currently 26 Nov 2014 16:53



Post new topic Reply to topic  [ 3 posts ] 
How to FIND more than one string? 
Author Message

Joined: 05 Sep 2011 09:15
Posts: 114
Post How to FIND more than one string?
I wanna extract two pieces of info, for example,

1. BIOS
2. Computer Name

Two questions (see comments below)
Consider this, please:

criterion.log
Quote:
BIOS
Computer Name


Code:

@ECHO OFF


:: How can I use
:: TYPE systeminfo >> C:\systeminfo.log

   systeminfo > C:\systeminfo.log

   FOR /F "tokens=* delims=" %%G In (C:\criterion.log) DO (
      :: How can I
                :: TYPE file | FIND string1 string 2 >> newfile
      TYPE C:\systeminfo.log | FIND "%%G" >> C:\extracted.log      

   )

PAUSE



Last question:
How can I do the above task without the for loop in the criterion log?


27 Feb 2012 04:15
Profile

Joined: 10 Feb 2012 02:20
Posts: 4418
Post Re: How to FIND more than one string?
Use findstr with the /c switch, twice.


27 Feb 2012 04:47
Profile

Joined: 05 Sep 2011 09:15
Posts: 114
Post Re: How to FIND more than one string?
Nice one. Thanks.


27 Feb 2012 07:19
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.