cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Cannot Load CSV from local Import directory using "Load CSV

I am using Neo4j Desktop. have placed csv files in the Import Directory on my machine.

There are 2 columns in the csv - 'VendorID' and 'Vendor'

I have used the following query:
</> LOAD CSV WITH HEADERS FROM "file:///Vendors.csv" AS line CREATE (:Vendor {VendorID: Line.VendorID, Name: line.Vendor}) </>

I get the following error:
"Neo.ClientError.Statement.ExternalResourceFailed
Couldn't load the external resource at: file:/C:/Users/tomfi/.Neo4jDesktop/neo4jDatabses/database-94a4e4b-4810-49ec-8fc7-5f5b434bb122/installation-3.5.12/import/Vendors.csv"

Can anyone advise bearing in mind I am a novice?!

Thanks

Tom

1 ACCEPTED SOLUTION

And the good news is that was the problem and I have found the right Import directory, put the files in it and LOAD CSV has worked

View solution in original post

3 REPLIES 3

You seem to have a number of spelling errors: line vs Line and also neo4jDatabses
perhaps that's the reason it can't find the directory?

Many thanks Michael and my apologies for the typos. However, they are typos in my post rather than the query.

The query I used was in fact:
</> LOAD CSV WITH HEADERS FROM "file:///Vendors.csv" AS line CREATE (:Vendor {VendorID: line.VendorID, Name: line.Vendor}) </>

The error message I got was:
"Neo.ClientError.Statement.ExternalResourceFailed
Couldn't load the external resource at: file:/C:/Users/tomfi/.Neo4jDesktop/neo4jDatabases/database-94a46e4b-4810-49ec-8fc7-5f5b434bb122/installation-3.5.12/import/Vendors.csv"

However, I have just checked the path to the file shown by file explorer on my local drive and see that it is to a different database to the above:
"C:\Users\tomfi.Neo4jDesktop\neo4jDatabases\database-96e6bd25-40a2-4d78-8eb2-4a04795c913c\installation-3.5.12\import"
So that must be the problem and I need to figure out what to do about it. I have two databases but only see one Import Directory and the LOAD CSV command is looking at the wrong database for some reason that I have not figured out! I will have to do some more digging. Many thanks for your reply I really appreciate it.
Tom

And the good news is that was the problem and I have found the right Import directory, put the files in it and LOAD CSV has worked