Avatar of H
H

asked on 

PowerShell - csv with delimiters inside double quotes

Hi,

Currently I'm using the following to insert a row of data into a datatable:

$Delimiter = ','
$null = $datatable.Rows.Add($line.Split($Delimiter))

The delimiter can change from a comma, semi-colon, pipe etc

If a value within double quotes contains for example a comma, the data is split out incorrectly. I'm just wondering the best way to handle delimiters in values please?

Thanks,
Helen
Powershell

Avatar of undefined
Last Comment
zalazar

8/22/2022 - Mon