I would like to Split a row into two labels while importing the data with CSV. Whereas manufacturer node is already created and the split action will be done to connect a relationship between manufacturer and vehicle type.
I'm assuming you want to MATCH the first column with your existing manufacturer and then CREATE a Vehicle Type and also a relationship with it
WITH [["JEA1_Z21", "Bulker"], ["KLQ2_Z34", "Truck"]] as rows // you should change this to your LOAD CSV....
UNWIND rows AS row
WITH
row[0] AS manufacturer,
row[1] AS vehicleType
MATCH (m: Manufacturer { id: manufacturer})
WITH m, vehicleType
MERGE (v:VehicleType {id: vehicleType})
MERGE (m)-[:LOADS]->(v)
If I understand correctly you could try to do something like:
LOAD CSV FROM 'file:///file.csv' AS row
MERGE (v:Vehicle {type: row[1]})
MERGE (m:Manufacturer {code: row[0]})
MERGE (m)-[:LOADS]->(v)
You just have to move the file.csv (of course this would depend on your file name) with your data into the import folder of your Neo4j installation, if you are using Neo4j Desktop it should be accessible through the DBMS options menu.