cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

Import data from a CSV file containing headers doesnt work

Hi all,

running the neo4j

Neo4j Browser version: [4.3.3]
Neo4j Server version: 4.2.11

ad trying LOAD CSV - Neo4j Cypher Manual

and putting the csv file to my gitlab repository

LOAD CSV WITH HEADERS FROM 'https://git.......net/product/neo4j/-/blob/master/resources/data.csv' AS line CREATE (:Artist {name: line.Name, year: toInteger(line.Year)})

i am getting

At https://git.........net/product/neo4j/-/blob/master/resources/data.csv @ position 47396 - there's a field starting with a quote and whereas it ends that quote there seems to be characters in that field after that ending quote. That isn't supported. This is what I read: '#8fbc8f":'

πŸ™‚ But i dont have anywhere quotes, i am using the same structure from the example

Id,Name,Year
1,ABBA,1992
2,Roxette,1986
3,Europe,1979
4,The Cardigans,1992

Any idea what is wrong?

Thank you

2 REPLIES 2

wadie_almouhtad
Node Link

Hi .
can please you try :

CREATE CONSTRAINT UniqueName ON (k:Artist) ASSERT k.name is unique ;
LOAD CSV WITH HEADERS FROM 'https://git .......net/product/neo4j/-/blob/master/resources/data.csv' AS line
MERGE (a :Artist {name: toString(line.Name) })
on create set a.year=toInteger(line.Year)

Cannot merge the following node because of null property value for 'name': (a:Artist {name: null}) (Failure when processing file '/product/neo4j/-/blob/master/resources/data.csv' on line 2.)

i have tryed to moved the file to git hub reporository

and from there data was loaded, funny is that structure is weird, cause it create 1200 nodes in format

{
"identity": 258,
"labels": [
"Artist"
],
"properties": {

}
}

but at least its doing something. So my previous error is probably caused by some interna access isssue to the company gitlab and the data which is trying to parse are some exception message.

Marek