Welcome Forums General PowerShell Q&A Need to club all the CSV data into a single CSV

Viewing 2 reply threads
  • Author
    Posts
    • #11233
      Participant
      Topics: 23
      Replies: 26
      Points: 0
      Rank: Member

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

      -Biswajit

    • #11234
      Member
      Topics: 9
      Replies: 2322
      Points: 0
      Rank: Member
      $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
      Participant
      Topics: 23
      Replies: 26
      Points: 0
      Rank: Member

      Thanks Dave.

Viewing 2 reply threads
  • The topic ‘Need to club all the CSV data into a single CSV’ is closed to new replies.