Code: Select all
@Echo Off
setlocal EnableDelayedExpansion
Set _InputFile=master.txt
For /F "tokens=1-6 delims=|" %%A IN (%_InputFile%) DO (
Set _server=%%A
Set _database=%%B
Set _username=%%C
Set _pwd=%%D
Set _name=%%E
Set _type=%%F
echo Processing %_server%
if "%_type%"=="s" (
[do stuff...]
) else (
[do stuff...])
)
And here's an example input file:
Code: Select all
servera|dba|usera|xxx|DM|s
serverb|dbb|userb|yyy|PMT|m
And the output:
Code: Select all
Processing dbb
Processing dbb
I figure it must be the parameters in the for command, but I can't get it to work for the life of me... any suggestings very appreciated!
Regards, Al