I have a data file, data.txt
Code:
1 0.011070 0.5100 0.4900 1.0211
9 2
11 19 8 7
2 0.021373 0.1000 0.0870 1.1332
8 13
6 14 5 9
and so on..
The first no. is n (going 1,2,... till 100).
Now, I am having a nightmare of a time in making a C code for reading this data.
How can I make a C code to read data.txt, such that I can make the following matrices :
a[1][1]=0.011070, a[1][2]=0.5100, a[1][3]=0.4900, a[1][4]=1.0211
b[1][1]=9, b[1][2]=2
c[1][1]=11, c[1][2]=19, c[1][3]=8, c[1][4]=7
Similarly, for n=2 (4th, 5th & 6th rows)
a[2][1]=0.021373, a[2][2]=0.1000, a[2][3]=0.0870, a[2][4]=1.1332
b[2][1]=8, b[2][2]=13
c[2][1]=6, c[2][2]=14, c[2][3]=5, c[2][4]=9
and I go upto n=100.
As is clear, I want matrix a to be float, and b and c as int.
*The no. of columns of array a,b and c are same for all n.
PLEASE KINDLY HELP SOON, AM BADLY STUCK.
Regards
Alice