neo4j - Import a csv file inNeo4j -
i want import in neo4j csv file. here example of file team.csv:
_id,official_name,common_name,country,started_by.day,started_by.month,started_by.year,championship,stadium.name,stadium.capacity,average age,squad value(in mln),foreigners cel.00,real club celta de vigo s.a.d.,celta vigo,spain,30,11,1988,la liga,balaƬdos,29500,25.7,60.4,10
to import in neo4j used:
load csv headers 'file:///z:/path/to/file/team.csv' line create (p:team {_id:line._id, official_name:line.official_name, common_name:line.common_name, country:line.country, started_by_day:"line.started_by.day",started_by_month:"line.started_by.month",started_by_year:"line.started_by.year", championship:line.championship,average_age:"line.average age", squad_value:"line.squad value(in mln)", foreigners:line.foreigners}), (p1:stadium {name:line.stadium.name, capacity:line.stadium.capacity})
it imports properties except stadium information:name , capacity. in fact this:
load csv headers 'file:///z:/path/to/file/team.csv' line return line.stadium.name
returns:
i don't understand why thing happens. stadium properties in csv file.
if column header has 'strange' characters inside, dots, need quote header using backticks:
load csv headers 'file:///z:/path/to/file/team.csv' line return line.`stadium.name`
Comments
Post a Comment