Can somebody tell me how to read a csv file with numeric headers in powershell Eg:
1,2,3,4,5,6
value1,value2,value3,value4,value5,value6
value1,value2,value3,value4,value5,value6
value1,value2,value3,value4,value5,value6
I tried following
$csvObject = Import-Csv -Path <file name>
ForEach ($dataRow in $csvObject) {
$val1 = $dataRow.1
Write-Host $val1
}
and it didn't work, can someone guide me how should I read this file?
$dataRow."1".ToUpper(). Everything works as expected now. Thanks for your time again. Oh what am I gonna do with this question now