Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a file (file.txt) that contains multiple lines
of data. Each line has 10 columns, delimited
by commas. I need to write column 1, 5 and
10 to a file using the echo command.I have:
for /f "tokens=1,2,3,4,5,6,7,8,9,10 delims=,"
%%a in (file.txt) do set store=%%a&set
description=%%e&set plu=%%j&echo %store%
%plu% %description% >> %report_file%This is working, except that it is only
processing (or at least writing) the last line in
file.txt to my report. I'm sure I'm missing
something simple, but I'm not getting it.Any suggestions would be greatly appreciated.

Thank you! I got it to work with one minor change:
for /F "tokens=1,5,10 delims=," %%i IN (file.txt) do echo.%%i
%%j %%k>> %report_file%

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |