Need to club all the CSV data into a single CSV

This topic contains 2 replies, has 2 voices, and was last updated by Profile photo of Biswajit Biswajit 3 years, 5 months ago.

  • Author
    Posts
  • #11233
    Profile photo of Biswajit
    Biswajit
    Participant

    Need to club all the CSV data into a single CSV. Culumn headers are same for all the CSVs

    -Biswajit

  • #11234
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator
    $sources = '.\file1.csv','.\file2.csv','.\file3.csv'
    $sources | Import-Csv | Export-Csv '.\output.csv' -NoTypeInformation
    

    There's also an -Append switch to Export-Csv, but you don't need it if everything's in one pipeline like that.

  • #11289
    Profile photo of Biswajit
    Biswajit
    Participant

    Thanks Dave.

You must be logged in to reply to this topic.