Solved Output columns from csv

Dell / Latitude e6420
February 13, 2014 at 07:31:27
Specs: Win 7 Pro x64, I7 Sandy Bridge 2.201 GHz / 8072 MB
All,
I'm new to batch programming. I have created a for loop to take 2 columns out of a .csv file and export them to a new .csv file. See code:

@echo off
setlocal
for /f "tokens=1,4 delims=," %%G in (
appearances.csv) do echo %%G %%H >> extract.xls

This works fine and does what it's supposed to, however in the new .csv that is created it takes both of the selected columns and combines them into one column. Is there a way to make the 2 columns separate in the new csv that is generated?

~winipcfg

ASCII Question, Get an ANSI


See More: Output columns from csv

Report •

#1
February 13, 2014 at 08:51:55
✔ Best Answer
I'm not an expert in batch scripting, but I'd think it would be as simple as adding a comma to the echo statement.

echo %%G, %%H


Report •

#2
February 13, 2014 at 09:08:25
Yea that's all it took. Thank you!

~winipcfg

ASCII Question, Get an ANSI


Report •
Related Solutions


Ask Question