I'm new in Neo4j and I'm facing some issues when loading data from a local file in a Windows 10 system to a sandbox instance of Neo4j 3.5
Basically the command is this: LOAD CSV WITH HEADERS FROM 'C:\Users\Renato\Desenvolvimento\laboratorios.csv' AS row RETURN trim(row.name), row.fundation, trim(row.companyId)
But it never ran. It keep sending over and over the same message:
Neo.ClientError.Statement.SyntaxError
Neo.ClientError.Statement.SyntaxError: Invalid input 's': expected four hexadecimal digits specifying a unicode character (line 2, column 11 (offset: 32)) "FROM 'C:\Users\Renato\Desenvolvimento\laboratorios.csv'"
I really don't get why it is expecting an unicode character here. Anyway, I don't know how to proceed and I have no http server to use as source of the file "laboratorios.csv".
I understod that you creared a python code to upload data to your neo4j. Now I'm evaluating if neo4j would apply to my solution, and I really don't want to code (much). Do you know how to turn around this 'local file' issue using features from CYPHER or BOLT?
I created a test CSV file and tested your script against my test database:
LOAD CSV WITH HEADERS FROM 'File:///laboratorios.csv' AS row RETURN trim(row.name), row.fundation, trim(row.companyId)
trim(row.name)
row.fundation
trim(row.companyId)
"Laborat�rio 1"
"31/12/2010"
"##Laborat�rio140543"
"Laborat�rio 2"
"17/03/2007"
"##Laborat�rio239158"
I did not duplicate your error--however, this produced the same issue I described in an open Topic for the same problem. I am running on OpenSuse and Neo4j. However, I will try again on my Windows box and see if I can get the same error you had.
P.S. I know that you can use MATCH and SET statements to correct characters in the database to replace the grey "diamond-?" symbols.
I noticed you used 'File:///laboratorios.csv' instead of 'C:\Users\Renato\Desenvolvimento\laboratorios.csv'. My opinion is that OPEN CSV is unable to locate a local file in my system.
Anyway, I apreciate your support to figure out what is going on here.
What worked for me was the combination of the 'file:///filename.csv' AND the file being put into the Import folder within the database you are trying to populate. I found this info out here: How-To: Import CSV Data with Neo4j Desktop - Developer Guides
For now I am evaluating a sandbox instance of Neo4j, and that's what I think is causing the issue. See, I am trying to upload a file from my local system to this sandbox instance through a browser using LOAD CSV and seems that the browser is not able to locate the file properly.
True...I used Linux in my testing, which is my primary OS; hence, the process is the same regardless the OS used for Neo4j. Sharon provided a good resource; I prefer using the manual myself. Refer to LOAD CSV - Cypher Manual.