nested For Loop
Posted: 19 Aug 2008 03:27
Hiya,
I am stuck with a nested for loop and variable assignement, I am trying to do the following :-
SET /a COUNT=1
IF 2 NEQ 0 (
FOR /L %%G IN (1,1,2) DO (
REM ECHO %%G
ECHO %COUNT%
FOR /F "tokens= %COUNT%-2delims=$" %%A IN ("AAA$BBB%") DO (
ECHO %%A
set /a COUNT+=1
ECHO %COUNT%
)
)
)
But the COUNT variable never seems to be incremented and always has value of 1! Could anyone please help?
Thanks for your time..
P!
I am stuck with a nested for loop and variable assignement, I am trying to do the following :-
SET /a COUNT=1
IF 2 NEQ 0 (
FOR /L %%G IN (1,1,2) DO (
REM ECHO %%G
ECHO %COUNT%
FOR /F "tokens= %COUNT%-2delims=$" %%A IN ("AAA$BBB%") DO (
ECHO %%A
set /a COUNT+=1
ECHO %COUNT%
)
)
)
But the COUNT variable never seems to be incremented and always has value of 1! Could anyone please help?
Thanks for your time..
P!