0

I have this piece of code which loads a csv from another site.

LOAD CSV FROM 'https://www.quackit.com/neo4j/tutorial/genres.csv' AS line
CREATE (:Genre { GenreId: line[0], Name: line[1]})

enter image description here

But when I upload the same csv to my github account and try it, it gives me an error.

LOAD CSV FROM 'https://www.quackit.com/neo4j/tutorial/genres.csv' AS line
CREATE (:Genre { GenreId: line[0], Name: line[1]})[![enter image description here][2]][2]

enter image description here I only changed the link and nothing else. How do I resolve this?

Jp Reddy
  • 366
  • 1
  • 4
  • 15

1 Answers1

1

You need to use the RAW version of the file.

On your github repo, click on your genres.csv file and then click on RAW

enter image description here

Then copy the url and use it in your LOAD CSV command :

https://raw.githubusercontent.com/JP-Reddy/Recommendation-Engine/master/genres.csv

Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
  • Also how do import from my pc? 'file:C/path/destination/file.csv' isn't working. I'm using windows – Jp Reddy Jun 22 '17 at 09:39
  • 1
    you need to put it in the import directory of the neo4j db or allow (via the neo4j config) to traverse the filesystem. Check the neo4j documentation ;-) – Christophe Willemsen Jun 22 '17 at 09:41