I have a CSV file with five columns and hundreds of rows. I would like to add a header to each column. such as
| number | Test | data1 | data2 | DataNs |
|---|---|---|---|---|
| zero | test0 | random | random | random |
| firster | test1 | random | random | random |
| First | test2 | random | random | random |
| Second | test3 | random | random | random |
I have tried the following code, which does add the headers successfully, however, it is also combining all columns into one. which is not what I want
import-csv $NoHeadersExport -Header 'number', 'Test', 'data1', 'data2', 'DataNs' | export-csv $exportPath -NoTypeInformation
this code is leading to following table
| number | Test | data1 | data2 | DataNs |
|---|---|---|---|---|
| zerotest0randomrandomrandom | ||||
| firstertest1randomrandomrandom | ||||
| Firsttest2randomrandomrandom | ||||
| Secondtest3randomrandomrandom |