To create nodes for each row in CSV file and relationships for sub items

Hey naikum,
This is some pseudocode that may get you started:

for i from 1 to n
  match node1 where name = "P" + str i 
  match node2 where name starts with "P" + str i and size > 2
  create node1-[:knows]->node2

It is hacky, though.