Batch to re-order CSV columns

November 29, 2010 at 16:03:33
Specs: Windows Server 2008 R2
Hello,

I am exporting to csv from AD but csvde does not order the columns. So I require a batch file to order the columns based on the column name.

E.g.
name,department,number
john,IT,9999
bob,accounts,8888

to

number,name,department
9999,john,IT
8888,bob,accounts

Thank you very much in advance.


See More: Batch to re-order CSV columns

Report •

#1
November 29, 2010 at 16:50:40
@echo off > newfile & setLocal enableDELAYedeXpansion

for /f "tokens=1-3 delims=," %%a in (AD.csv) do (
>> newfile echo.%%c,%%a,%%b
)


=====================================
Life is too important to be taken seriously.

M2


Report •
Related Solutions


Ask Question