I have to import a huge dataset and i use the neo4j-import tool. However my dataset follows the structure below :
1,"lorem1", "ipsum1","foo1"
2,"lorem2", "ipsum2","foo2"
3,"lorem3", "ipsum3","\"
And it throws an error when it reads "\".I know it's the backslash character which means it is waiting a quotation. I would like to know if it's possible to deactivate the backslash meaning in the neo4j-import tool ?
I think that this is an issue with the tool that you used to export the CSV having a different idea what the CSV standard is than Neo4j. This is understandable because the CSV format isn't well standardized ;)
According to neo4j-import --help
:
--quote <quotation-character>
Character to treat as quotation character for values in CSV data. The default
option is ". Quotes inside quotes escaped like """Go away"", he said." and "\"Go
away\", he said." are supported. If you have set "'" to be used as the quotation
character, you could write the previous example like this instead: '"Go away",
he said.'
So this means that Neo4j allows you to escape quotes both with double quoting (""
) and with backslash escaping (\"
). Normally what I've seen is one or the other, and of course both sides need to agree on what the format is.
I would guess if you escaped your backslashes like this that it might work:
1,"lorem1", "ipsum1","foo1"
2,"lorem2", "ipsum2","foo2"
3,"lorem3", "ipsum3","\\"
You could also use that command to change your quote character (say to '
or even |
). Of course you would need to re-generate your CSV with that in mind.
But no, it doesn't look like there's a way to have Neo4j change the way that it interprets escaped quotes in CSV.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With