Import data from CSV

CSV stands for Comma Separated Value.

LOAD CSV statement is used to import data from a CSV file into a Neo4j database. It facilitates you to load CSV files into Neo4j form other database i.e. relational database.

You can load a CSV file from a local or remote URL. Use a file:/// URL, to access a local stored file (on the database server), Otherwise, you can import remote files using any of the HTTPS, HTTP, and FTP protocols.


Load a CSV file

Let's load a CSV file named "names.csv" using the HTTP protocol. It contains a list of 10 names, so it will create 10 nodes.

Example

Import the CSV file from local storage:

Output:

Neo4j Import data from csv 1

You can use the following query to see the newly created nodes:

Output:

Neo4j Import data from csv 2




Latest Courses