Solved adding filename into csv file using bat

June 12, 2012 at 03:17:24
Specs: Windows 7
Hi everyone,

I have a problem with auto created .csv files.

I want to add the .csv file name into the .csv file.

The .csv file format is like this:

date date number number

I would like to make a batch file who can create a new column in the .csv file and write the file name to it.

Thank you in advance.

See More: adding filename into csv file using bat

Report •

June 12, 2012 at 05:47:09
✔ Best Answer
:: ===== script starts here ===============
:: cmc.bat Tue 12-06-2012 19:39:40.98
@echo off > newfile & setLocal enableDELAYedeXpansioN

set N=my
for /f "tokens=* delims= " %%a in (my.csv) do (
>> newfile echo.!N!, %%a

goto :eof

::====== script ends here =================

Life is too important to be taken seriously.


Report •
Related Solutions

Ask Question