Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

Use Powershell

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading