CSV文件未正确加载

时间:2014-11-16 16:36:55

标签: csv neo4j cypher

使用HEADERS FROM"文件加载CSV:C:/CSV/film.csv" AS行 CREATE(:Film {film_id:row.film_id,title:row.title,description:row.description, release_year:row.release_year,language_id:row.language_id,original_language_id:row.original_language_id, rental_duration:row.rental_duration,rental_rate:row.rental_rate,length:row.length,replacement_cost:row.replacement_cost,rating:row.rating, special_features:row.special_features,last_update:row.last_update});

我在NEO4J中写了这个查询。执行后,它用

表示我

" 添加了500个标签,创建了500个节点,在1709毫秒内返回0行"

但它不显示节点的属性!我不明白为什么!

P.S:一行csv文件和标题是:

" row.film_id,row.title,row.description,row.release_year,row.language_id,row.original_language_id,row.rental_duration,row.rental_rate,row.length,row.replacement_cost,row.rating ,row.special_features,row.last_update " 1","学院恐龙","一个女性主义和疯狂科学家的史诗剧,他们必须在加拿大落基山脉中与一位教师作战#"," 2006"" 1"" N," 6"" 0.99"" 86"&# 34; 20.99"," PG","删除场景,幕后花絮",#34; 2006-02-15 05:03:42" "

请帮助我,我已经完成了作业。 :(

2 个答案:

答案 0 :(得分:2)

删除所有列中csv标题行中的row.前缀。如果是迭代变量,row中的LOAD CSV

答案 1 :(得分:1)

您可以像Stefan建议的那样做,也可以调整您的查询以考虑实际的字段名称:

LOAD CSV WITH HEADERS FROM "file:C:/CSV/film.csv" AS row 
CREATE (:Film {film_id: row.`row.film_id`, title: `row.row.title`});

等等......