In abc.bat, define a subroutine func1. In func1, get valOfI and valOfO from command line. Order of “-i valOfI” and “-o valOfO” can be any in command line.
Very appreciate for your help and patience. Your explanation is valuable and rare. Very clear and helpful and into detail. Hope this could help others.
Sorry, I have not state my question in accuracy. This is another question. I want to know why following two commands have different output: echo " %str1% echo %str1% if definition of str1 is: set str1="a^!bcd^!efg^^^^^^^^^^^!^^^^^^^!^^^^^^^^^^!hi^^^^^^^^^!^^^^!^!" or if definition of str1 after remo...
code: set "^=escapeOnly" set hi=hi001 set str1="a^!bcd^!efg^^^^^^^^^^^^^!^^^^^^^^^^^!^^^^^^^^^^!hi^^^^^^^^^!^^^^!^!" echo ----- original ---- echo !str1! echo ----- other 4 ----- 2x echo " %str1% output: ----- original ---- "a!bcd!efg^^^^^^!^^^^^!^^^^^^^escapeOnly " ----- other 4 ----- 2x " "aefg^!^...
:test5 setlocal DisableDelayedExpansion set /a "n=0" for /f "delims=" %%i in (txt1.txt) do ( set "line=%%i" setlocal EnableDelayedExpansion set "str_out=!str_out! / number{!n!}-{!line!}" rem debug echo !str_out! endlocal&set "str_out_1=%str_out%" set /a "n+=1" echo Position 1: echo str_out_1=%str_o...
:test2 setlocal DisableDelayedExpansion set "line1= abc # %%var1%% # ^!var2^!" for /f "usebackq delims=# tokens=1,2,3*" %%i in ('%line1%') do ( echo {%%i} echo {%%j} echo {%%k} ) endlocal goto :eof There are 3 space characters at both sides of “abc” in variable line1. But after I split line1 by for...
Hi Steffen, Look following code: :test6 setlocal EnableDelayedExpansion set "lines_cnt=2" set "in_file=temp.txt" set "line=" set /a "n=0" <"!in_file!" ( for /l %%j in (1 1 !lines_cnt!) do ( set "line=" &set /p "line=" if defined _ret ( set "_ret=!_ret!^&" ) set "_ret=!_ret!set %~1[!n!]=!line! set /a...