parsing - Parse a simple text file with dos cmd line -
i have text file (vernum.txt) containing 1 line:
at revision 2.
how use dos cmd line read in line , save variable number? "at revision ####."
by using command such this:
@echo off set /p myvar=<vernum.txt echo myvar=%myvar% /f "tokens=3* delims=.\ " %%k in ( "%myvar%" ) ( set /a result=%%k ) echo number is: %result% pause
Comments
Post a Comment