The simplest way is to get the wc.exe utility from either http://gnuwin32.sf.net or http://unxutils.sf.net.
Then do the following: c:\>findstr /v OK filename.txt | wc -l That will spit out the number of lines that don't contain OK. Kurt On Wed, Oct 26, 2011 at 00:48, Oliver Marshall <[email protected]> wrote: > Hi chaps > > > > Any good DOS people here? Can someone help me with a batch file command line > ? > > > > I want to return the number of lines within a text file that don’t contain > OK. > > > > That is I’ll have a text file like this; > > > > Value 1 : OK > > Value 2 : FAIL > > Value 3 : OK > > Value 4 : WARNING > > > > I want to return the number of lines that don’t have OK on them. > > > > Any ideas? > > > > Olly > > > > ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ > ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ > > --- > To manage subscriptions click here: > http://lyris.sunbelt-software.com/read/my_forums/ > or send an email to [email protected] > with the body: unsubscribe ntsysadmin ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~ --- To manage subscriptions click here: http://lyris.sunbelt-software.com/read/my_forums/ or send an email to [email protected] with the body: unsubscribe ntsysadmin
