Solved Delete First Row & Column of CSV

February 2, 2014 at 00:37:00
Specs: Windows 7
Hello i i would like a batch file to delete the first column and first row of multiple csv files saved in a folder leaving the file format unchanged.


Thanks
Bobby


See More: Delete First Row & Column of CSV

Report •


#1
February 2, 2014 at 07:08:47
✔ Best Answer
With the CSVs in x: [substitute your folder]

::====== script starts here ===============
::
:: bobby.bat 2014-02-02 21:55:33.76
@echo off & setLocal enableDELAYedeXpansioN

:main
pushd x
@echo off > NEWFILE
for /f "tokens=* delims= " %%a in ('dir/b *.csv') do (
call :sub1 %%a
)
goto :eof

:sub1
for /f "tokens=1* skip=1 delims=," %%i in (%1) do (
echo.%%j
) >> NEWFILE
move/y NEWFILE %1
goto :eof
::====== script ends here =================

=====================
M2 Golden-Triangle


Report •

#2
February 2, 2014 at 07:54:16
Please what line do i put my file path

Report •

#3
February 2, 2014 at 11:40:45
Bobby asks:
Please what line do i put my file path

On the line below :main.

Like this:

pushd "d:\files"

=====================
M2 Golden-Triangle


Report •

Related Solutions


Ask Question