CSV crash: "Quote located in unquoted token"

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Fri Oct 13 18:53:37 UTC 2017


On Friday, 13 October 2017 at 08:53:12 UTC, Dmitry wrote:
> Hi there.
> When I load csv, it crashes ("Quote located in unquoted token") 
> on lines with quotes, like this:
>
> ResourceNode_RemoveFromView_Confirm,You are about to remove 
> ""{0}"" from view ""{1}"". Continue?,You are about to remove 
> ""{0}"" from view ""{1}"". Continue?,,Resource Tree - 
> confirmation of removal from the current view

The problem is that a generic CSV parser can't tell what the 
expected data should look like if the data doesn't follow defined 
rules. std.csv is not filled with custom parsing rules.

You can use Malformed.ignore[1], but your data will come out like:

You are about to remove ""{0}"" from view ""{1}""

This would leave you needing to modify the "".

1. https://dlang.org/phobos/std_csv.html#.Malformed


More information about the Digitalmars-d-learn mailing list