I want to import a CSV matrix with a header line and NxN cells to import including the specific relationship type which looks like the following:
id, name, element1, element2,..., elementX
1, element1,,1;2,2;5,,1;2,...
2, element2,3,,4;5,...
...
N, elementX
Using the cypher code below only imports one column, how do I iterate through each column?
LOAD CSV WITH HEADERS FROM 'file:///test.csv' AS line WITH line
WHERE line.element1 IS NOT NULL
Match (c:element{id: toInteger(line.id),name: line.name})
Match (d:element{name:'element1'})
Merge (d)-[:REL{type: line.element1}]-(c)
return c,d