I have a unique situation that I'm wondering how to solve. I have an array and i'm initializing as follows:
Code: Select all
FOR %%a IN (
"FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA"
"FDRBS|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA"
"FDRCS|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE|STORE_DATA"
) DO FOR /F "tokens=1-4 delims=|" %%A IN (%%a) DO (
SET "STR[%%A].DLR=%%B"
SET "STR[%%A].LOC=%%C"
SET "STR[%%A].IMP=%%D"
SET "STR[%%A].EXP=%%E"
)
I can dynamically build a check each time I set the FILENAME variable, but where I'm failing is once it hits "FDR", it always stops there because it always renders true. Here is what I tried:
Code: Select all
FOR /L %%A IN (1,1,100) DO (
CALL SET "MASK=%%FILENAME:~0,%%A%%"
CALL SET "_CHECK=%%STR[!MASK!].DLR%%"
IF DEFINED _CHECK GOTO BREAK
)
:BREAK
echo %MASK%
echo %_CHECK%
pause
Code: Select all
FDR_20210912.csv
FDRBS_20210912.csv
FDRCS_20210912.csv
I hope I made sense, let me know if you need more info.