Bat file, count lines in if statement.

October 25, 2011 at 18:22:33
Specs: Windows Server
I know how to count the number of lines using console: FIND /C /I "<TD" example.html
However how do i make a if statement so if the lines are above 100 then it executes a command, but if not simply exits?

Any help is appreciated.
Thanks,


See More: Bat file, count lines in if statement.

Report •

#1
October 26, 2011 at 09:53:20
If you mean in a batch file, it would be something like:

@echo off
set count=0
for /f "tokens=*" %%a in (example.html) do (
set /a count=%count% + 1
if %count% -lt 100 goto under100
'execute command'
:under100
exit


Report •
Related Solutions


Ask Question