Forum Discussion
mark_carlisle
5 years agoAdvocate IV
Removing square brackets from column headers DAX query
I'm attempting to streamline an extremely convoluted process developed by one of my colleagues that involves exporting data from a Power BI report, renaming various columns, then uploading the final ...
- 5 years ago
You're right. I see it too. How about this?
$Results | export-csv -Path $ExportPath -NoTypeInformation
(Get-Content -Path $ExportPath ) -replace '[\[\]]' | Set-Content -Path $ExportPath
lbendlin
5 years agoSuper User
How about this crude approach?
$Results -replace '[\[\]]' | export-csv -Path $ExportPath -NoTypeInformation
mark_carlisle
5 years agoAdvocate IV
Nice try unfortunately I just get a single column called Length with the number 19 in it which is the number of characters in the first column. Tried a few other regex combinations to remove just one or specify nothing as its replacement, same result. Figured it was going to need something hacky in PS to achieve.