My aim is to look for the value "error" in the file "output.txt" and assign its line number to a variable.
The problem with the below script is that after executing it, "K.%f%" is always "K.0". I want it to get incemented as K.1, K.2 etc., but that doesnt happen..
for /f "tokens=1 delims=" %a in ('find /n "error" ^< d:\output.txt') do (
set /a f+=1
set /a K.%f% = %a
Can any one help me on this?