尝试:在linux下解析excel数据
来源:互联网 发布:vscode eclipse快捷键 编辑:程序博客网 时间:2024/05/29 13:48
【前言】先赞一个,这种变态的需求。
【原文】http://www.libxl.com/
Direct reading and writing Excel files
LibXL is a library that can read and write Excel files. It doesn't require Microsoft Excel and combines an easy to use and powerful features. Library can be used to
- Generate a new spreadsheet from scratch
- Extract data from an existing spreadsheet
- Edit an existing spreadsheet
LibXL can help your applications in exporting and extracting data to/from Excel files with minimum effort. Also it can be used ever as report engine. Library can be used in C, C++, C#, Delphi, Fortran and other languages. Supports Excel 97-2003 binary formats (xls) and Excel 2007/2010 xml formats (xlsx). Supports Unicode and 64-bit platforms. There are a wrapper for .NET developers and separate Mac and Linux edition.
Simple interoperate, no more Excel dependency
LibXL has C/C++ headers, Delphi unit and .NET assembly for including in your project. No OLE automation.
Customizing the look and feel
LibXL supports numerous formatting options: alignments, borders, colors, fill patterns, fonts, merging cells and so on.
High performance
Writing speed is about 2 100 000 cells per second for numbers and 240 000 cells per second for 8-character random strings in binary format (CPU 3.2 GHz).
Royalty-free distribution with your application
Our customers can use this library in theirs commercial applications without any fees.
Code example: generate a new spreadsheet from scratch
#include "libxl.h"using namespace libxl;int main() { Book* book = xlCreateBook(); if(book) { Sheet* sheet = book->addSheet(L"Sheet1"); if(sheet) { sheet->writeStr(2, 1, L"Hello, World !"); sheet->writeNum(3, 1, 1000); } book->save(L"example.xls"); book->release(); } return 0;}
Code example: extract data from an existing spreadsheet
Book* book = xlCreateBook();if(book){ if(book->load(L"example.xls")) { Sheet* sheet = book->getSheet(0); if(sheet) { const wchar_t* s = sheet->readStr(2, 1); if(s) wcout << s << endl; double d = sheet->readNum(3, 1); cout << d << endl; } } book->release();}
Code example: edit an existing spreadsheet
Book* book = xlCreateBook();if(book) { if(book->load(L"example.xls")) { Sheet* sheet = book->getSheet(0); if(sheet) { double d = sheet->readNum(3, 1); sheet->writeNum(3, 1, d * 2); sheet->writeStr(4, 1, L"new string"); } book->save(L"example.xls"); } book->release(); }
Code example: apply formatting options
Font* font = book->addFont();font->setName(L"Impact");font->setSize(36); Format* format = book->addFormat();format->setAlignH(ALIGNH_CENTER);format->setBorder(BORDERSTYLE_MEDIUMDASHDOTDOT);format->setBorderColor(COLOR_RED);format->setFont(font); Sheet* sheet = book->addSheet(L"Custom");if(sheet){ sheet->writeStr(2, 1, L"Format", format); sheet->setCol(1, 1, 25);}book->save(L"format.xls");
- 尝试:在linux下解析excel数据
- Linux下JNI尝试
- 日常:在MAC平台下,有关数据解析,HTML生成Excel档
- Flash/Flex/AIR:在LINUX下尝试开发AIR应用
- 在ubantu下尝试WxPython
- linux 下 git 初尝试
- java 解析 excel数据excel
- java解析excel数据
- 导入excel解析数据
- Excel导入解析数据
- Javascript解析Excel数据
- 以usb-modeswitch配华为LTE上网卡EC5373在Linux下试图上网的尝试
- 在linux环境下尝试使用gcc编译一个程序,并验证-E\-S\-c选项
- 在Linux下安装JDK图文解析
- 在linux下使用 ngrok 解析
- python中保留excel中原数据的情况下在excel的添加新的数据
- 在ssh框架下将数据生成Excel文件导出
- 尝试用OLEDB打开EXCEL表读取数据
- RMAN备份全集
- python 正则表达式操作指南
- 基于超级电容的太阳能草坪灯设计方案
- 找到了一个网站,内容很多
- 数据库优化与应用程序性能的五个平衡点
- 尝试:在linux下解析excel数据
- 第一天
- 数据库连接性能深度探索
- 优化数据库大幅度提高Oracle的性能
- 超大型Oracle数据库应用系统的设计方法
- 常见的HTTP错误
- 图解Linux VNC-Server服务器搭建
- Oracle中被锁定的解决办法
- iPhone的有锁、无锁、解锁、越狱、破解