Link to home
Start Free TrialLog in
Avatar of Michael Asgian
Michael Asgian

asked on

Powershell: how to append to a CSV instead of out to a new CSV

I need a bit of help. Total beginner with Powershell.

I have a Powershell script that ends up with

out-file "C:\test\result.csv"

How can I have those results pasted at the end of an existing CSV instead of writing a new file?

thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of netcmh
netcmh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Export-CSV does more than just create a CSV file, so it might not be suitable. And the -Append parameter requires at least PowerShell 3 (shouldn't be a restriction anymore, though).
Out-File has -Append, too.
Yes, you could do that as well. The export-csv has so much more options in terms of formatting that Out-file simply does not support. And, seeing that you were intending to work with CSVs, I thought it best if you were introduced to export-csv.
Avatar of Michael Asgian
Michael Asgian

ASKER

Worked like a charm! Thank you all!
You're welcome. Thank you for the grade. Good luck!