setlocal EnableDelayedExpansion
set m=0
for /f "tokens=*" %%m in ('findstr /v /C:"730 730" cover.ps') do (
if !m! == 686 (pause) else (echo %%m >>cover3.txt)
set /a m=!m! + 1
)
paus
exit
This is a batch script written by brother kcdsw. He himself said there are the following problems:
If you use set and then echo, then the % in the text will be replaced.
If you use call without enabling variable delay, when passing %%m from for to call, things will also be lost.
So I still enabled variable delay, and the result is that the! are all gone. I hope experts can give advice.
I want to put aside these problems for now.
I want to ask experts to explain according to this example how variable delay works and why it is delayed.
From the sentence above "If you use call without enabling variable delay, when passing %%m from for to call, things will also be lost", I guess it is because parameters cannot be passed between the two segments, and variable delay is used. I have checked a lot on the Internet and still don't fully understand variable delay, so I hope experts will focus on explaining.
[ Last edited by yuanzijia08 on 2006-11-4 at 02:31 PM ]
set m=0
for /f "tokens=*" %%m in ('findstr /v /C:"730 730" cover.ps') do (
if !m! == 686 (pause) else (echo %%m >>cover3.txt)
set /a m=!m! + 1
)
paus
exit
This is a batch script written by brother kcdsw. He himself said there are the following problems:
If you use set and then echo, then the % in the text will be replaced.
If you use call without enabling variable delay, when passing %%m from for to call, things will also be lost.
So I still enabled variable delay, and the result is that the! are all gone. I hope experts can give advice.
I want to put aside these problems for now.
I want to ask experts to explain according to this example how variable delay works and why it is delayed.
From the sentence above "If you use call without enabling variable delay, when passing %%m from for to call, things will also be lost", I guess it is because parameters cannot be passed between the two segments, and variable delay is used. I have checked a lot on the Internet and still don't fully understand variable delay, so I hope experts will focus on explaining.
[ Last edited by yuanzijia08 on 2006-11-4 at 02:31 PM ]
