1,ABBA,1992
2,Roxette,1986
3,Europe,1979
4,The Cardigans,1992
1.导入csv
LOAD CSV FROM 'https://neo4j.com/docs/developer-manual/3.4/csv/artists.csv' AS line
CREATE (:Artist { name: line[1], year: toInteger(line[2])})
2.导入csv,包含头
Id,Name,Year
1,ABBA,1992
2,Roxette,1986
3,Europe,1979
4,The Cardigans,1992
LOAD CSV WITH HEADERS FROM 'https://neo4j.com/docs/developer-manual/3.4/csv/artists-with-headers.csv' AS line
CREATE (:Artist { name: line.Name, year: toInteger(line.Year)})
3.导入特殊格式csv
1;ABBA;1992
2;Roxette;1986
3;Europe;1979
4;The Cardigans;1992
LOAD CSV FROM 'https://neo4j.com/docs/developer-manual/3.4/csv/artists-fieldterminator.csv' AS line FIELDTERMINATOR ';'
CREATE (:Artist { name: line[1], year: toInteger(line[2])})
4.一行一行导入
USING PERIODIC COMMIT
LOAD CSV FROM 'https://neo4j.com/docs/developer-manual/3.4/csv/artists.csv' AS line
CREATE (:Artist { name: line[1], year: toInteger(line[2])})
5.Setting the rate of periodic commits
6.Import data containing escaped characters
参考文献:
https://neo4j.com/docs/developer-manual/3.4/cypher/clauses/load-csv/