Skip to content

Instantly share code, notes, and snippets.

@conrjac
Created November 17, 2016 09:52
Show Gist options
  • Save conrjac/9fa3f00305cfb8503654faf86b565902 to your computer and use it in GitHub Desktop.
Save conrjac/9fa3f00305cfb8503654faf86b565902 to your computer and use it in GitHub Desktop.
Powershell Script to merge multiple CSV files into one (by appending each file to the end)
$files = Get-ChildItem [INPUT FOLDER PATH - e.g C:\Data\]*.csv
Get-Content $files | Set-Content [OUTPUT FILE PATH - e.g C:\Data\MergedCsvFile.csv]
@ktran235
Copy link

I have several CSV files: file1.csv file2.csv file2.csv .... they all have the same columns, I need a powershell script to combine them together into one csv file, I found many PW scripts, but yours is the easiest to understand and the simplest to fit my need, Thank you so much. Keep up the good works. I will visit this site very often as I have more PW scripts to write.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment