

InterviewSolution
Saved Bookmarks
1. |
Solve : Dos Batch Variables? |
Answer» <html><body><p>Looking for a was to restate if "!<a href="https://interviewquestions.tuteehub.com/tag/line-239358" style="font-weight:bold;" target="_blank" title="Click to know more about LINE">LINE</a>!"=="19" in the following example to accept a variable Example: if "!LINE!"==%value% <br/><br/><br/>SET S=%%i<br/>SET LINE=0<br/>for /F "delims=" %%<a href="https://interviewquestions.tuteehub.com/tag/l-236827" style="font-weight:bold;" target="_blank" title="Click to know more about L">L</a> in (%FILE%) do (<br/> set /A LINE += <a href="https://interviewquestions.tuteehub.com/tag/1-236780" style="font-weight:bold;" target="_blank" title="Click to know more about 1">1</a><br/> if "!LINE!"=="19" (<br/> set STR=%%L<br/> echo. !STR:~8!> %TEMP%.\T1.DAT<br/> FINDSTR /B /C:"TLAXIS" %TEMP%.\T1.DAT > nul<br/> del %TEMP%.\T1.DAT<br/> if not errorlevel=1 (<br/> set NAME=%FILE%.vec<br/> copy %FILE% %LOC%\%FILE%.vec<br/> cls<br/> echo.Looking for a way to restate if "!LINE!"=="19" in the following example to accept a variable! Example: if "!LINE!"==%value% <br/>(before the FOR statement)<br/>set value=19<br/><br/>(in the loop)<br/>if "!LINE!"=="%value%" (<br/><br/>or<br/><br/>if !LINE! equ %value% (<a href="https://interviewquestions.tuteehub.com/tag/thank-1731949" style="font-weight:bold;" target="_blank" title="Click to know more about THANK">THANK</a> YOU AGAIN! Works <a href="https://interviewquestions.tuteehub.com/tag/perfect-1150611" style="font-weight:bold;" target="_blank" title="Click to know more about PERFECT">PERFECT</a>!</p></body></html> | |