I had a large comma delimited, text quoted text file that I need to modify. Some of the data has a CR/LF within its double quotes. This happens all through out the file. Here is an examle.
“123”, “bla bla CR/LF bla bla”, “Alpha 123”, “signature CR/LF Tom Jones”, …, CR/LF
I need only the CR/LF’s removed that are within the double quotes, the ones at the end of the line must stay (they are outside of the double quotes).
Any help would be much appreciated!
[string]$line = "" Get-Content ".\test.csv" | ForEach-Object { if (!([Regex]::Matches(($line += $_), '"').Count -band 1)) { $line; $line = "" } }How To Ask Questions The Smart Way