如何在unix环境中读取数据并修改excel中的数据 [英] How to read data and modify data in excel in unix environment

查看:126
本文介绍了如何在unix环境中读取数据并修改excel中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发布的代码可以帮助我解决这个问题。



I have posted the code could somebody help me to sort out this issue.

#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;
}

推荐答案

我还需要在TCP / IP模型中如何在服务器和客户端之间建立通信。
And i also need how communication can be established between server and client in TCP/IP model.


XLS文件正在使用 Excel二进制文件格式 [ ^ ]。因此,您无法使用C文本I / O函数读取和写入它们。



您可以使用可用于您的Unix的办公产品,它能够读写那些文件(例如OpenOffice,LibreOffice)。



如果你需要以编程方式读写文件,最好选择Excel也支持的简单文件格式像CSV或HTML。
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.


这篇关于如何在unix环境中读取数据并修改excel中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆