Member Avatar

Hi all,

I'm trying to replace text in a CSV.

The CSV line looks something like this:

"Field One","Field Two","Field
Three","Field Four"

So I tried something like:

(Get-Content $csvfile) -replace "Field`n", "Field" | Set-Content $csvfile
Member Avatar

I should be specific; that line I posted didn't work.

Member Avatar

This seems to fix that one line:

Import-CSV $csvfile | Export-CSV $csvfile
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.