I have 80+ uniquely named .csv files I need to remove the first 17 lines from. I am new to writing batch scripts, but would like to use this opportunity to learn.
I have been able to make this sample code work for a single file when I rename a file to test.csv, but it would be preferred if there was a "Wild Card" for file name I could use.
@echo off
set "csv=test.csv"
more +17 "%csv%" >"%csv%.new"
move /y "%csv%.new" "%csv%" >nul
File itself is updated to NOT have the first 17 lines and renames named as it is started.
try like this :
@echo off
for %%a in (*.csv) do (
more +17 "%%a" >"%%a.new"
move /y "%%a.new" "%%a" >nul
)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments