Parse text file line by line and split each line and store in matrix form.

data1,true,2000,422
data2,false,2001,421
data3,true,2050,427
data4,true,2004,432
the above data is in sample.txt. I want to write a program using a for loop and any filereader class or by any means, such that my output will be stored in as follows:

My_Data[1]= data1,true,2000,422
My_Data[1][0]= data1
My_Data[1][1]= true
My_Data[1][2]= 2000

My_Data[2]= data2,false,2001,421
My_Data[2][0]= data2
My_Data[2][1]= false
I want to access each My_Data[i] individually and under that My_Data[i][0] ,My_Data[i][1] and so on .

Can anyone please help writing this type of code ?