我在Windows 7上,我是Neo4J的新用户,我正在使用Neo4J 3.0.3版本。 我有一个简单的小csv文件,只是为了尝试如何将csv文件导入Neo4j。
这是我的文件,名为people.csv
1,"John"
10,"Jane"
234,"Fred"
4893,"Mark"
234943,"Anne"
从neo4j浏览器的控制台我尝试以不同的方式导入此文件,但没有运气。 这些是我的尝试:
USING PERIODIC COMMIT 10000 LOAD CSV FROM "file:///C:\Utenti\Luca\Desktop\people.csv"
which returned this error: Invalid input 't': expected four hexadecimal digits specifying a unicode character (line 1, column 56 (offset: 55))
"USING PERIODIC COMMIT 10000 LOAD CSV FROM "file:///C:\Utenti\Luca\Desktop\people.csv""
然后我尝试用斜杠。
USING PERIODIC COMMIT 10000 LOAD CSV FROM "file:///C:/Utenti/Luca/Desktop/people.csv"
and the error was:
Unexpected end of input: expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR or AS (line 1, column 86 (offset: 85))
"USING PERIODIC COMMIT 10000 LOAD CSV FROM "file:///C:/Utenti/Luca/Desktop/people.csv""
答案 0 :(得分:3)
第二个查询中的路径看起来是正确的。但你没有做任何事情LOAD
csv文件。
错误告诉您在第一行(第86列是行尾)之后需要某事。
尝试例如返回前几行:
USING PERIODIC COMMIT 10000
LOAD CSV FROM "file:///C:/Utenti/Luca/Desktop/people.csv" AS line
WITH line
RETURN line
LIMIT 5
如果您想创建内容,请阅读手册:http://neo4j.com/docs/developer-manual/current/#query-load-csv