Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have posted the code could somebody help me to sort out this issue.

XML
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
int main( )
{
  FILE * fp;
  char name[300],city[300],dept[300];
  fp=fopen("sampledata.xls", "r");
  if(!fp) {
   printf("File failed to open!\n");
   exit(1);
  }
  fscanf(fp,"%s%s%s",&name,&city,&dept);
  fclose(fp);
  fprintf(stdout,"First Line is %s%s%s\n", name, city, dept);
  return 0;
}
Posted
Updated 6-Oct-14 18:37pm

And i also need how communication can be established between server and client in TCP/IP model.
 
Share this answer
 
XLS files are using the Excel Binary File Format[^]. So you can't read and write them using C text I/O functions.

You may use an office product available for your Unix that is able to read and write those files (e.g. OpenOffice, LibreOffice).

If you need to read and write files programmatically it would be better to choose a simple file format that is also supported by Excel like CSV or HTML.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900