PS code that I'm using is
$headers = "BBB", "CCC" $files = Import-Csv "C:\Users\karol\Desktop\CSV_TEST\Files.csv" -Header $headers $files
The result are not what it would looks like.
Any idea what is the issue? THX
Enter a comma-separated list of the column headers. Enclose each item in quotation marks (single or double). Do not enclose the header string in quotation marks. If you enter fewer column headers than there are columns, the remaining columns will have no header. If you enter more headers than there are columns, the extra headers are ignored.
When using the Header parameter, delete the original header row from the CSV file. Otherwise, Import-Csv creates an extra object from the items in the header row.
Seems like your original CSV file already has headers ... at least AAA and BBB. Either you use the existing headers in CSV file or you specify them with your cmdlet. If I'm not wrong you cannot combine them.
You must be logged in to reply to this topic.