如何读取和写入Excel文件? [英] How to read from and write to an Excel file?

查看:91
本文介绍了如何读取和写入Excel文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c ++中输入和输出到Excel文件?
如何从Excel文件获取数据以及如何从Excel文件获取数据.
输出文件如何逐行显示??
请举例说明.
我想在这个例子中,得到输入文件,并给出输出文件.
我将归档此程序,但无法获取输入和输出.
您只需输入和输出,即可完成我的程序.
感谢您早日答复.

Input and output to Excel file in c + +?
How to get data from Excel files and how to get out of the Excel file.
How is the output file line by line???
Please answer with examples..
I would like in this example, I get the input file, and to give the output file.
I''ll file this program, but can not get the input and output.
You, with an input and output, complete my program.
Thanks for the answer you early.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#define FILE_IN "exel.xlsx"
#define FILE_OUT "report.xlsx"
int main( ){
    string a;
    ifstream input;
    ofstream output;
    input.open(FILE_IN);
    output.open(FILE_OUT);
    input.close();
    output.close();
    return 0;
    }


字符串输入.
字符串输出.


string a input.
string a output.

推荐答案

很多建议

首先,请阅读以下内容: http://support.microsoft.com/kb/196776 [如何在中读取和写入Excel文件通过ADO的C ++ [ ^ ],
如何使用托管C ++使Excel自动化 [ ^ ],
使用C ++自动执行Excel的类库(DLL) [ ^ ].

希望对您有所帮助;)
First of all, read this: http://support.microsoft.com/kb/196776[^], then, please, see these links:
How to Read and Write Excel Files in C++ via ADO[^],
How to use Managed C++ to Automate Excel[^],
Class Library (DLL) to Automate Excel in C++[^].

I hope it helps ;)


您不能以流的形式读取和写入Excel文件,它们具有自己的结构.

走开,研究一下我昨天给您的链接,甚至还有一篇CodeProject文章,它将确切地告诉您如何开始.
You cannot read and write Excel files as streams, they have a structure of their own.

Go away and study the links I gave you yesterday, there is even a CodeProject article that will show you exactly how to get started.


这篇关于如何读取和写入Excel文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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