Why here echo double times?
Posted: 22 Oct 2024 07:38
Hi all,
This code below I was using before. But today I used it again just found that it echo double times, I need know why that happened...
The Sample.txt just list as NAXAUTO-1 NAXAUTO-2 NAXAUTO-3 NAXAUTO-4 NAXAUTO-5 NAXAUTO-6 NAXAUTO-7 NAXAUTO-8 NAXAUTO-9 NAXAUTO-10 NAXAUTO-11 NAXAUTO-12
I used this code to test each values in this Sample.txt has been echo properply but it echo twice the second round just ECHO is off
The output as below:
NAXAUTO-1
NAXAUTO-2
NAXAUTO-3
NAXAUTO-4
NAXAUTO-5
NAXAUTO-6
NAXAUTO-7
NAXAUTO-8
NAXAUTO-9
NAXAUTO-10
NAXAUTO-11
NAXAUTO-12
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
Why it echo twice and I need clean output
Thanks
This code below I was using before. But today I used it again just found that it echo double times, I need know why that happened...
The Sample.txt just list as NAXAUTO-1 NAXAUTO-2 NAXAUTO-3 NAXAUTO-4 NAXAUTO-5 NAXAUTO-6 NAXAUTO-7 NAXAUTO-8 NAXAUTO-9 NAXAUTO-10 NAXAUTO-11 NAXAUTO-12
I used this code to test each values in this Sample.txt has been echo properply but it echo twice the second round just ECHO is off
Code: Select all
@echo off
set TC_ID=Sample
for /f "tokens=1-12 delims=," %%A in (C:\CATA_AUTO\ata-master\BVT\BVTTAG\FAPS\%TC_ID%.txt) do call :ManualRepl %%A %%B %%C %%D %%E %%F %%G %%H %%I %%J %%K %%L
:ManualRepl
set "var1=%~1"
set "var2=%~2"
set "var3=%~3"
set "var4=%~4"
set "var5=%~5"
set "var6=%~6"
set "var7=%~7"
set "var8=%~8"
set "var9=%~9"
shift
set "var10=%~9"
shift
set "var11=%~9"
shift
set "var12=%~9"
echo %var1%
echo %var2%
echo %var3%
echo %var4%
echo %var5%
echo %var6%
echo %var7%
echo %var8%
echo %var9%
echo %var10%
echo %var11%
echo %var12%
NAXAUTO-1
NAXAUTO-2
NAXAUTO-3
NAXAUTO-4
NAXAUTO-5
NAXAUTO-6
NAXAUTO-7
NAXAUTO-8
NAXAUTO-9
NAXAUTO-10
NAXAUTO-11
NAXAUTO-12
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
ECHO is off.
Why it echo twice and I need clean output
Thanks