#1 2020-08-03 00:20:38

LynnDion41
Member
From: Canada, St Georges
Registered: 2020-08-03
Posts: 1

I had a need to combine multiple CSV files

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:ScriptsCSVFiles | Select-Object -ExpandProperty FullName | Import-Csv | Export-Csv C:ScriptsCSVFilesCombinedFile.csv -NoTypeInformation -Append    Idea of this method is    Get the filenames with full path of the CSV filesImport them all Pipe the import the CSV files to Export-CSV to a file.
Note the “-Append” parameter.
Hope this help you too.
.

Offline

W88yes

Board footer

Powered by FluxBB