I had a need to combine multiple CSV files. And worked for few minutes and came up with this PowerShell method.
Get-ChildItem -Filter *.csv -Path C:\Scripts\CSVFiles | Select-Object -ExpandProperty FullName | Import-Csv | Export-Csv C:\Scripts\CSVFiles\CombinedFile.csv -NoTypeInformation -Append
Idea of this method is
- Get the filenames with full path of the CSV files
- Import them all
- Pipe the import the CSV files to Export-CSV to a file. Note the “-Append” parameter.
Hope this help you too.