I'm unable to ignore spaces in my FOR loop token parsing, Am I doing something wrong??
For /F "tokens=1-5 delims=," %%I IN (%_InputFile%) DO (
ECHO %%I
Call process_machine %%~I %%~J %%~K %%~L %%~M
)
The text file as lines like:
997_m1,/turfcare/997_M1_9M94,997_M1_9M94.xlsm,\\f05tc1\shared\V2Net\115778 - TC997T4 MY13MuleData Collection\,9M94 M1
Can't remove <space> FOR delimiter
Moderator: DosItHelp
Re: Can't remove <space> FOR delimiter
It's not a problem of your FOR loop but it's a problem of how you call your sub routine. You have to enclose arguments with spaces in quotation marks.
Regards
aGerman
Code: Select all
@echo off &setlocal
set "_InputFile=test.txt"
For /F "tokens=1-5 delims=," %%I IN (%_InputFile%) DO (
ECHO %%I
Call :process_machine "%%~I" "%%~J" "%%~K" "%%~L" "%%~M"
)
pause
goto :eof
:process_machine
echo %~1
echo %~2
echo %~3
echo %~4
echo %~5
goto :eof
Regards
aGerman