I'm using PowerShell to run and export a SQL query. By default my output file has " " around the values, but one of the requirements is to only return raw data, so I piped in | % {$_ -replace '"',""} |
to address that, however one of the fields is a text field that contains measurements that have " for length I need to maintain.
My questions is how to apply | % {$_ -replace '"',""} | to everything BUT one field.
If I had a string content as similar to a CSV file content with 3 columns: Col1, Col2, Col3 I would write something like this:
The script removes only double quotes, that surround the fields.
Note: Extending arrays in a loop with += is inefficient