2
votes

Im trying to import csv files from disk with cypher commands as shown in the tutorial, but Im getting "Couldn't load the external resourse at: externalResourceFailure. Is there any "roadmap" for importing csv in windows from files? Thank you in advance!

6
as a start i saw that you have to write like "file:///test/test1.csv unlike the tutorial(CSV files can be stored on the database server and are then accessible using a file:// URL)... If anyone has "grouped" information, please provide!!Nektarios Kyriakou
paste please the resource address you are using, or the whole import cypher commandulkas
LOAD CSV WITH HEADERS FROM "file:///test/kommata6.csv" AS csvLine CREATE (p:Party {id: toInt(csvLine.id), label: csvLine.Label, grparl: csvLine.grparl, euparl: csvLine.euparl}) , and it works fine for a start now. Thank you!Nektarios Kyriakou

6 Answers

5
votes

take alook at SyntaxException with Neo4j LOAD command

in the question, step 3, please check if you path to the file is correct on your operating system:

the syntax for accessing a local file on windows is simply "file:c:/nosql/test/unclaimed.csv" and not file:// as might be inferred from examples on ...

4
votes

You have to put the files into the import directory in neo4j.

3
votes

it will work if path like this "file:///C:/myfile.csv"

1
votes

The Windows and Linux file systems require different file URI schemes for streaming over HTTP. Neo4j's LOAD CSV Cypher clause makes an HTTP web request to the URI of a file and not the file system path.

For more information on file URI schemes on Windows please take a look at: http://en.wikipedia.org/wiki/File_URI_scheme#Windows_2

1
votes

You can also create a folder import into your neo4j installation folder and run a cipher like this

LOAD CSV WITH HEADERS FROM "file:///yourcsvfile.csv" AS row
0
votes

On mac: create a folder inside the Neo4j directory. Neo4j will install in Documents (by default)

mkdir /Users//Documents/Neo4j/default.graphdb/import

Copy your file in this location

Use it like this

USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///user_list.csv" as row create (:Users {userId: row.USER_ID });