hi all..
i'm creating program that will read a csv file..
let say,,the csv file content 10 rows of data like this..
now, algorithm that i'm using is,Code:10,23,444,-33,45,33,22,445,44,34 1,23,444,-33,45,33,22,445,44,34 -120,23,444,-33,45,33,22,445,44,34 10,23,44,-33,45,33,22,445,4,34 10,23,4,-33,45,33,22,445,44,34 10,23,-44,-33,145,33,22,4,44,34 10,23,444,-33,45,33,22,445,44,34 10,23,444,-33,45,233,22,445,44,34 10,23,444,-33,45,33,22,-45,44,34 10,23,444,-33,45,323,22,445,44,34
1) read the data line by line using fgets() and save it to
a char array , let say
szLine_data[256]
2) then seperate and throw out comma
3) the problem now is,, i'm doing processing character by character.
so,, after throw out comma, i dont know how to put let say character 4, 4, 4 to a char array..
what i'm doing now is,,
it means that szTmp content comma also at the last element..Code:while(szLine_data[l] != ',') { szTmp[l] = szLine_data[l]; l++; }
how to throw the comma and the balance of the element..
??