CSV File 1 (Headers File):
Heading 1, Heading 2, Heading 3 ...
CSV File 2 (Data File):
Data Record 1, Data Record 2, Data Record 3 ...
File 1 contains the headers only, whereas File 2 contains the data which corresponds to the headers in File 1. Is it possible to append the data in File 2, to the Headers in File 1 via a PowerShell script, so File 2 (or a new file) will now look like:
Output CSV File
Heading 1, Heading 2, Heading 3 ...
Data Record 1, Data Record 2, Data Record 3 ...
Appologies for the question formatting, first post here. Would you very grateful for any help, thank you in advance!
Import-CSVcmdlet has a-Headerparameter. you could read the 1st file in withGet-Contentand use that as the value for the header parameter when you useImport-CSVon the 2nd file.