Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-23-2020 09:52 AM
Is it possible import data from CSV with out specify the column name .
I may get CSV file with different column name so I cant specify the column name at the time load csv command
Solved! Go to Solution.
09-23-2020 11:34 AM
The simplest way is to just create a node and load the columns as properties of a node:
LOAD CSV WITH HEADERS FROM "file:///" as row
CREATE (n:Node)
SET n+= row
That is basically it, other than that you would have to add some dynamic logic like:
LOAD CSV WITH HEADERS FROM "file:///" as row
UNWIND keys(row) as key
// do something depending on the column key
09-23-2020 10:58 AM
I don't think you're going to be able to do that unless you did something along the lines of loading the row of your CSV into a list and then unwinding while using a generic name like list item at the index of the place in the array. Which would make it very hard to standardize what you're doing. You'd probably be better off creating something in your programming language of choice and then using a Neo4j driver to interact with your instance vs. trying to something generic with the load CSV tool.
09-23-2020 11:13 AM
This is possible, but you are limited in how do you want to design your graph schema.
09-23-2020 11:14 AM
please let me know the possibilities. Also node level I need measure which need for further query
09-23-2020 11:34 AM
The simplest way is to just create a node and load the columns as properties of a node:
LOAD CSV WITH HEADERS FROM "file:///" as row
CREATE (n:Node)
SET n+= row
That is basically it, other than that you would have to add some dynamic logic like:
LOAD CSV WITH HEADERS FROM "file:///" as row
UNWIND keys(row) as key
// do something depending on the column key
09-23-2020 01:04 PM
Thanks . 1 st time it may work but not sure if it work for 2nd load ( run process 2nd time ; Merge )
09-24-2020 01:00 PM
Thanks . Its works some extended though need to tweet little bit as per requirement but Really help full .
09-23-2020 11:13 AM
Thanks for your quick reply and suggestion .
How Neo4j handle no sql scenario . Any idea ? I will try as you suggest by different programming ( python ) . I may plan python to pivot the data
All the sessions of the conference are now available online