updating data in cvs file using c programming

hi every one i want to read and write data from cvs file using c program. but my problem is that at run time my data is increasing in both row wise and column wise. that means it is continuously updating in both direction.
is there any way through which i can find the next colum or row for eg (row 4 ,col 3) and place my data into it
one thing more it is not necessary that that all rows have same number of column filled

any help would be appreciated
thanks