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.

Error in CSV importing procedure with CYPHER

I'm trying to import CSV with the CYPHER console.

I found example on this URL


Example:
LOAD CSV FROM 'https://neo4j.com/docs/cypher-manual/3.5/csv/artists.csv'

When I try to call this command with any kind of input file (local or with URL) I got this error

Neo.ClientError.Statement.SyntaxError
Unexpected end of input: expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR or AS (line 1, column 79 (offset: 78))
"LOAD CSV WITH HEADERS FROM "http://srv.sidelov.com:8000/20200228-FULL-1_1.csv""
^

Even when I try to run example without any changes from sample
LOAD CSV FROM 'https://neo4j.com/docs/cypher-manual/3.5/csv/artists.csv'

I got the same error
Unexpected end of input: expected whitespace, '.', node labels, '[', "=~", IN, STARTS, ENDS, CONTAINS, IS, '^', '*', '/', '%', '+', '-', '=', '~', "<>", "!=", '<', '>', "<=", ">=", AND, XOR, OR or AS (line 1, column 73 (offset: 72))
"LOAD CSV FROM 'https://neo4j.com/docs/cypher-manual/3.5/csv/artists.csv'"

What wrong with CSV importing syntaxis?

Thanks in advance!

3 REPLIES 3

Hi Pavlo,

Can you try this?

LOAD CSV FROM 'https://neo4j.com/docs/cypher-manual/3.5/csv/artists.csv' AS line
RETURN line

I know this is old, but its also incredibly helpful. I wish this would be in the documentation....thanks

Hi all. Trying to import a .csv via a public google drive file using the following cypher, but getting an errror msg (also shown below). My first time at this - any help very much welcomed:

LOAD CSV WITH HEADERS FROM 'Pipelines - Google Sheets' AS csvLine

CREATE (p:Pipeline {id: toInteger(csvLine.id), name: csvLine.pipelinename, capacity: csvLine.capacity, operator: csvLine.operator, commodity: csvLine.commodity})

Error msg:
Invalid input ' ': expected "CSV" (line 1, column 5 (offset: 4))
"LOAD csv WITH HEADERS FROM 'Pipelines - Google Sheets' AS csvLine"