computing
  • 0

Solved Delete First Row & Column Of CSV

  • 0

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

Share

1 Answer

  1. 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

    • 0