Home > Blockchain >  delete first row of multiple csv in a folder windows command line
delete first row of multiple csv in a folder windows command line

Time:10-20

I have multiple csv files in a folder.

I want to delete the first row of each csv in the folder using windows command line.

I am not familiar with windows command line so I will need information regarding how to call the folder within the console.

I do not want to make new files with the "subtracted" row, I just want to replace the original file or overwrite it.

CodePudding user response:

Use Powershell

Get-ChildItem "path\to\your\directory" -Filter *.csv | 
Foreach-Object {
    $import = Get-Content $_.FullName
    $import | Select-Object -Skip 1 | Set-Content $_.FullName
}
  • Related