0

I need to import CSV from a local folder (on my computer) on a server.

First I start the cypher-shell:

cypher-shell.bat -a bolt://<address>:7687 -u user -p secret

That works (I can do any Cypher-operation I want to do).

After that I try to load the data from my local neo4j-installation:
USING PERIODIC COMMIT LOAD CSV FROM 'C:/Users/.../neo4j-community-3.5.6/import/file.csv' AS line FIELDTERMINATOR ';' CREATE (:Term { name: line[1], description: line[2]});

I get an error: "unknown protocol: c". So I think, the declaration of the local path is wrong.

CB_Dev
  • 41
  • 5

1 Answers1

0

You need to prepend file:/// in the file path to specify when loading from the local file system.

USING PERIODIC COMMIT
LOAD CSV FROM 'file:///C:/Users/.../neo4j-community-3.5.6/import/file.csv' AS line FIELDTERMINATOR ';'
CREATE (:Term { name: line[1], description: line[2]});

By default, the neo4j import directory is set to $NEO4J_HOME/import. You need to comment following line in the neo4j.conf file:

dbms.directories.import=import
Rajendra Kadam
  • 4,004
  • 1
  • 10
  • 24
  • Ok, but now I get: "Couldn't load the external resource at: file:/usr/people/neo4j/run/.../import/C:/Users/.../neo4j-community-3.5.6/import/file.csv". I think "C:/.../file.csv" is interpreted as a file inside the import-folder on the the server. – CB_Dev Sep 20 '19 at 13:08
  • added more details – Rajendra Kadam Sep 20 '19 at 14:05
  • Thx for information. I just started a test regarding the further information (-> config-file). I get the same error, but the displayed path inside the error message is correct now. I also tested the path itself on my local computer to make sure that it is correct. It's ok. Maybe, there is a problem with access rights (windows 7)? – CB_Dev Sep 24 '19 at 13:51