2.6.10

Batch File - Reading a flat file

TEST.TXT:
indiana, brazil, 49
john, africa, 50
nicole, argentina, 13

----------------------------------------------------------------------------------------

FOR /f "delims=, tokens=1,2,3*" %%i in (C:\test.txt) DO call :read_file %%i %%j %%k
goto :END

:read_file
SET name=%1
SET country=%2
SET age=%3
ECHO %name%
ECHO %country%
ECHO %age%
goto :eof


:END
echo Execution Success!
exit 0

0 comentários:

Post a Comment