Concatenate csv files in powershell, without the first line (except for the first file)

后端 未结 2 1901
别跟我提以往
别跟我提以往 2021-01-15 20:34

I have multiple *.csv files. I want to concatenate them into a single CSV file in a powershell script. All csv files have the same header (the first line), so when I concate

2条回答
  •  余生分开走
    2021-01-15 21:01

    You could have done like this:

    (Get-ChildItem -Path $path -Filter *.csv).FullName | Import-Csv | Export-Csv $path\concatenated.csv -NoTypeInformation
    

    Where $path is the folder where the csv files exist. The final csv file will be in the same folder.

提交回复
热议问题