I am trying to get some information from a CSV about customers and the vehicles they want and then put this information in my program. In the CSV file there is a customer name and then underneath there name a list of vehicles they want.

I have already tried splitting the lines so that it stops adding vehicles to my list once i have reached the next customers name. 

This is the data in the CSV file i want to store the customer name in my listofCustomers and then store all the vehicles underneath there name in the customerVehicles list.

Alex

Car,Ford,GT40,1964,200000,987,Red,A3,2,4,False
Car,Ford,Fiesta,2001,2000,1015,Blue,fdssf1,4,1,True
Car,VolksWagon,Golf,2007,2000,1048,Orange,d3,5,1.8,True
Car,Audi,A4,2015,20000,1870,Black,23m,4,2,True
Truck,Toyota,Tundra,2017,35000,2700,Blue,bbb123,4000,4,2017
Car,Mercedes,C220,2001,3000,1450,Blue,1klvr,5,2.2,True
Plane,Boeing,707,1967,11000000,250000,Blue,r11ner,True,17845,41000,200,Jet

Jack

Car,Koenigsegg,CCX,2008,1200000,1721,White,lkn,2,5,True
Car,Pagani,Zonda F,2012,4200000,1520,White,5m,2,7.2,True
Car,Ford,Cortina,1984,3700,1200,Grey,rrr5,4,1.6,False
Car,Ford,Focus RS,2015,18000,1502,Black,erfwaew8,5,2,True
Car,VolksWagon,Jetta,2000,5755,1321,Brown,ewr4,5,1.8,False
Car,Audi,S8,2009,7500,3150,Green,fdasf7,4,4,True
Plane,Supermarine,Spitfire,1942,510000,108000,Green,spft,False,40,20000,2,Prop

Ben

Car,Audi,A4,2004,4195,1850,Green,fd11,5,2.8,True
Car,BMW,M4,2018,62000,2005,Matt Black,aa34,5,4,True
Car,Mercedes,C220,2015,24000,1440,White,asp98,5,2.2,True
Plane,Schempp-Hirth,Janus C,2000,45000,750,White,dsfsd22,True,1200,10000,2,None

Eva

Helicopter,Robinson,R22,1995,120000,1500,Black,22222f,False,150,15000
Plane,Supermarine,Spitfire,1939,8000000,14000,Green,ffff3,False,8000,20000,4,Prop
Car,Audi,RS3,2018,54000,1995,Coral,dsf23,5,4.2,True
Car,BMW,M4,2017,48000,2018,Pink,fdsgd1,5,4,True
Truck,Ford,F150,2016,18000,1900,Grey,f15044t,4000,4,2017

```
List<string> listofCustomers  = new List<string>();
List<List<baseVehicle>> customerVehicles = new List<List<baseVehicle>>();

string[] lines = File.ReadAllLines("Customer.CSV");

string customer = "";
customer = lines[0];
listofCustomers.Add(customer);
customerVehicles.Add(new List<baseVehicle>());
for (int i = 1; i < lines.Length; i++)
{
    string[] bits = lines[i].Split(',');
    if (bits[0].ToUpper() == "Car".ToUpper())
    {
        Car Car = new Car(bits[0], bits[1], bits[2], int.Parse(bits[3]), int.Parse(bits[4]), int.Parse(bits[5]), bits[6], bits[7], int.Parse(bits[8]), double.Parse(bits[9]), bool.Parse(bits[10]));
       customerVehicles.Last().Add(Car);
    }
    if (bits[0].ToUpper() == "Truck".ToUpper())
    {
        Truck Truck = new Truck(bits[0], bits[1], bits[2], int.Parse(bits[3]), int.Parse(bits[4]), int.Parse(bits[5]), bits[6], bits[7], int.Parse(bits[8]), int.Parse(bits[9]), int.Parse(bits[10]));
        customerVehicles.Last().Add(Truck);
    }
    if (bits[0].ToUpper() == "Helicopter".ToUpper())
    {
        Helicopter Helicopter = new Helicopter(bits[0], bits[1], bits[2], int.Parse(bits[3]), int.Parse(bits[4]), int.Parse(bits[5]), bits[6], bits[7], bool.Parse(bits[8]), int.Parse(bits[9]), int.Parse(bits[10]));
        customerVehicles.Last().Add(Helicopter);
    }
    if (bits[0].ToUpper() == "Plane".ToUpper())
    {
        Plane Plane = new Plane(bits[0], bits[1], bits[2], int.Parse(bits[3]), int.Parse(bits[4]), int.Parse(bits[5]), bits[6], bits[7], bool.Parse(bits[8]), int.Parse(bits[9]), int.Parse(bits[10]), int.Parse(bits[11]), bits[12]);
        customerVehicles.Last().Add(Plane);
    }
    else if(bits[0] == "" )
    {
        return;
    }
}

```