tags:

views:

116

answers:

1

HI I am using SED to find total number of lines of txt file. want to assign the output of sed to variable BAT file.

I used the below code to do this

for /f %%a in (`"sed15 -n $= TEST.TXT"') do set linenum=%%a

and I get the error message "the system cannot find the file `"sed15 -n $= TEST.TXT"'. how can we solve this?

A: 

It is looking for the file relative the the path you start the DOS command in. You can either give a full path for the file - c:\text.txt etc or start the command in the right directory.

Sam Cogan