HI Aacini -
Thank you very much!! I really like your methodology and I'm going to poke around with it now! In the mean time, I still need to leverage my current methods until I'm able to make the switch.
With that said, I do believe I still need my first for loop otherwise it does not cycle through all options.
For instance, when I use this method, it will loop through both definitions:
Code: Select all
FOR %%a IN (
"FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE"
"FDR1|DLR_DATA_FDRII1,DLR_DATA_FDRII1|inbox/LOC_DATA_FDRII|REPLACE"
) 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"
)
But if I remove the first FOR LOOP and build like this, it will cycles through the first definition:
Code: Select all
FOR /F "tokens=1-4 delims=|" %%A IN (
"FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE"
"FDR1|DLR_DATA_FDRII1,DLR_DATA_FDRII1|inbox/LOC_DATA_FDRII|REPLACE"
) DO (
SET "STR[%%A].DLR=%%B"
SET "STR[%%A].LOC=%%C"
SET "STR[%%A].IMP=%%D"
)
So I think I need to use 2.
I do have a question on values as I'm running into an issue when I have a value I need to quote. In the 4 position, we have values that have a space in them so I need to quote in order to load successfully in my target application.
If I run this, it bombs on the space even though it's quote. If I remove hte quotes, it's fine, but then it's not quoted when I need it to be later on. How do I get around this?
Code: Select all
FOR %%a IN (
"FDR|DLR_DATA_FDRII,DLR_DATA_FDRII|inbox/LOC_DATA_FDRII|REPLACE"
"FDR1|DLR_DATA_FDRII1,DLR_DATA_FDRII1|inbox/LOC_DATA_FDRII|Mode="REPLACE 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"
)