I have a csv file that I want to import but each line of the csv file contains data that i dont want to keep (need to be filtered) and length of each line is different (in one column might have two different information but it is still string). The csv file dont have header but it can be added using excel but i dont think its a good idea.
(id, typeA,typeB,typeC) --> header that i add in the csv
But some line, dont have type B, so it became like this
Is there a way i can import this kind of csv without modifying the csv?
You can load a CSV that doesn't have a header or even ignore the header by using a
SKIP 1. e.g.
load csv from "https://github.com/neo4j-contrib/training/raw/master/modeling/data/aircraft.csv" AS row WITH row SKIP 1 WHERE size(row) > 1 RETURN row LIMIT 20
We could then choose to process the lines differently depending on how many items they contain. e.g. maybe if we have 4 items we know that they are
id,typeA,typeB,typeC, but if we have 3 items then they are
Or do you have another way of determining which type each column represents?
I can also determine what a column present by their initals because we have a standard system in naming them such as LDN (London) is Place and BNG (router) is an Equipment. Is there a way we can create a block of name that we can fill with list of initials and classify them based on that ?
For my csv, each line means one connection.
typeA --connected--> typeB --connected--> typeC and Id represents identification of one connection/pathway. Therefore i also need to use MERGE for my csv.
I'm looking for way where we could identify the number of column that is not null, and from that we could the data identically based on the number of column for each row.