I'm using LOAD CSV
to import data from csv
to neo4j
. My dataset contains multiple values in the country
field. Currently I'm using a semicolon as the separator of those multiple values.
nodes-person.csv
id,country
http://author,country1;country2;country3
And this is the cypher query which I use to import data into neo4j
LOAD CSV WITH HEADERS FROM "file:///nodes-person.csv" AS csvLine
MERGE (p:`person` {id: csvLine.id})
ON CREATE
SET
p.country = split(csvLine.country,";")
ON MATCH
SET
p.country = split(csvLine.country,";")
RETURN p;
My question is, how can I split the values properly if the values contain the separator character.
ie:
country\\;1 ; country\\;2 ; country\\;3