In case it helps anyone arriving here, there's a few non-standard CSV requirements for importing array columns, included object mapped columns too.
Arrays: []
- Empty or Single entry are unquoted: [] or [75]
- Multiple entry are quote wrapped: "[6,73,74]"
Objects: {}
- Integer keys are always unquoted
- String keys are always sinhgle quoted
- Populated object {} are quote wrapped: "{95:26}" or "{'a':26}"
desc |
arrField |
arrdesc |
objField |
objDesc |
empty |
[] |
no quotes |
{} |
no quotes |
single int key |
[10] |
no quotes |
"{10:20}" |
wrap in " |
single str key |
['ten'] |
single quote |
"{'ten':20}" |
' (key) and wrap in " |
single str key val |
|
|
"{'ten':'twenty'}" |
' (key and val) and wrap in " |
multi arr/ob |
"[6,73,74]" |
wrap in " |
"{6:6,73:8,74:4}" |
wrap in " |
Example CSV raw - note the lack of double quotes.
one,two,three
[75],"{95:26}","{'a':66}"
[75],"{75:2}",{}
"[6,73,74]","{6:6,73:8,74:4}","{'a':8,'b':9,'c':6}"
"[340,272,205]","{340:2,272:2,205:2,206:2,208:2,141:2,142:4}","{'a':7}"
[204],"{204:2}",{}
"[142,141,73]","{142:2,141:4,73:4}","{'a':2,'b':4}"
[74],"{74:20}","{'a':36}"
"[5,74,73]","{5:2,74:10,73:8}","{'a':17}"