Solved batch file to update multiple csv files

Dell Poweredge t310 tower server - custo...
August 24, 2013 at 13:48:51
Specs: Windows Server 2003, Xeon
I am working with a few csv files that I need to output to another file using a Windows Batch file.
The csv files are named input1.csv, input2.csv, input3.csv, etc.
The batch file contents is below:
'@echo off '(for /F "delims=," %%A in (input1.csv) do echo %%A) > output1.csv

Is there a way to execute the batch file to apply to a group of .csv files all located in the same folder? Thanks for any info.


See More: batch file to update multiple csv files

Report •

#1
August 24, 2013 at 19:36:07
✔ Best Answer
maybe something like:
(for %%a in (input*.csv) do (for /f "delims=," %%b in (%%a) do (echo %%b)))>output1.csv

::======= end batch
which will output only the first field of each line of each file to output1.

message edited by nbrane


Report •

#2
August 24, 2013 at 19:57:19
I got some assistance on this (results are below):


@echo off
for %%x in (*.csv) do (
(for /F "skip=1 usebackq delims=," %%A in ("%%~x") do echo %%~A )> "%%~nx.new"
)

pause


Report •

#3
August 24, 2013 at 20:21:10
yeh, sorry about my typo (my middle finger has a bad infection on the tip-end). (also, my vision sucks, so the comma looked as good as a dot.) Thanks, looks like you got good help.

message edited by nbrane


Report •
Related Solutions


Ask Question