problem in accessing excel files
hi friends...
i am retrieving the excel file contents using c program and using strtok() function... but if my excel file contains data such as data1 data2 data3 data4 data5 data6 then my program is resulting as data1 data2 data3 data4 data5 data6 but i cant able to retrieve a single cell data alone.. tat is if i want to access data3 i cant able to retrieve.... can anyone help me..... thanks.... |
Quote:
(don't forget, in [CODE] tags, please). --- rod. |
theNbomr -
Quote:
Like theNbomr suggested - it might be nice if you gave some clues as to how you were trying to solve the problem - so we could intelligently suggest what might be going wrong. Additionally, I'm curious: how the heck are you trying to parse "an Excel file" (which, I presume, is a binary .xls or .xlsx file) ... with "C" and "strtok()"??? Thanx in advance .. PSM |
accessing excel files in c
hi..
my coding is [void main() { FILE *fptr; char *res; char name,data[175],val[20][20],data1,*dat[20]; int i=0,count=0,length; int x=0; clrscr(); fptr=fopen("data.csv","r"); while(name!=EOF) { name=getc(fptr); if(name!=' ') data[count]=name; count++; } i=0; res=strtok(data,","); while(res!=NULL) { printf("%s\n",res); dat[i]=res; printf("%s\n",dat[i]); i++; res=strtok(NULL,","); } fclose(fptr); getch(); } ] |
from the looks of it, its just a csv file, exported from excel, correct?
If you don't have constrain on the choice of language used (as in a homework), then just use a tool that helps you define rows and columns Code:
awk 'NR==1{print $3}' csvfile |
All times are GMT -5. The time now is 01:34 PM. |