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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -