I'm attempting to combine numerous csv files into a single outfile. It works okay in that the files are combined, however it changes the format of the outfile by making every line from the input files as a single value that just happens to contain commas. In other words, I get "1,2,3" in a single cell instead of "1" "2" "3" each in their own cell.
Get-Content C:\RollingLogs\*.csv | Out-File C:\CombinedLogs\outfile.csv
Here is a snip from the output file, if that helps to explain what's happening. The desired output is for "1" to be in column A, "2" in column B, etc. Instead we wind up with "1,2,3" all in column A.
I've tried specifying the comma as a delimiter with Out-File, but just makes everything a new line instead of keeping them in proper rows, which is worse. I also tried gc *.csv | Export-Csv outfile.csv but it just hangs without doing anything. Export-csv also changes the contents (1,2,3 from the input becomes "#TYPE System.Int32" and I don't know why). I have wondered if Import-Csv file1.csv | Export-Csv -Append outfile.csv might work, but since there are multiple input files it would require a foreach loop (I think?) and I have no idea how to do that.
Edit: Contents of the input file as seen in Notepad, to see delimiters
TCP,svchost.exe,1404,LISTENING TCP,System,4,LISTENING TCP,System,4,LISTENING
There are line breaks after the G, but they don't show up in StackOverflow without editing it more.