perl、python、tcl语法中读写Excel的模块

perl、python、tcl语法中读写Excel的模块

perl、python、tcl语法中存在读写xls和xlsx格式的模块分别有:

python

‌读取 Excel‌

‌xlrd‌ :支持传统 .xls 格式的读取‌
pandas‌:通过 read_excel() 方法支持 .xls 和 .xlsx 格式‌

‌写入 Excel‌

xlwt‌ :生成 .xls 格式文件‌
‌openpyxl‌:支持 .xlsx 格式的高效读写

网站资源:

https://editor.csdn.net/md/?articleId=146096071

‌Perl‌

‌读取 Excel‌

‌Spreadsheet::ParseExcel‌ :解析 .xls 文件‌
‌Spreadsheet::ParseXLSX‌:支持 .xlsx 格式‌

‌写入 Excel‌

‌Excel::Writer::XLSX‌ :生成 .xlsx 文件‌
‌Spreadsheet::WriteExcel‌(旧版):生成 .xls 文件

网站资源:

https://metacpan.org/author/JMCNAMARA

案例:

perl 复制代码
use Spreadsheet::WriteExcel;
# Create a new Excel workbook
my $workbook = Spreadsheet::WriteExcel->new('perl.xls');
# Add a worksheet
$worksheet = $workbook->add_worksheet();
#  Add and define a format
$format = $workbook->add_format(); # Add a format
$format->set_bold();
$format->set_color('red');
$format->set_align('center');
# Write a formatted and unformatted string, row and column notation.
my $col, $row;
$col = $row = 0;
$worksheet->write($row, $col, 'Hi Excel!', $format);
$worksheet->write(1,    $col, 'Hi Excel!');
# Write a number and a formula using A1 notation
$worksheet->write('A3', 1.2345);
$worksheet->write('A4', '=SIN(PI()/4)');

Spreadsheet::WriteExcel

模块存在方法有:

WORKBOOK METHODS

The Spreadsheet::WriteExcel module provides an object oriented interface to a new Excel workbook. The following methods are available through a new workbook.

new()

add_worksheet()

add_format()

add_chart()

add_chart_ext()

close()

compatibility_mode()

set_properties()

define_name()

set_tempdir()

set_custom_color()

sheets()

set_1904()

set_codepage()

‌TCL‌

‌读写 Excel‌

‌tcom 模块‌:通过 COM 接口调用 Excel 应用程序(需安装 Microsoft Office)

‌第三方扩展‌(如 tcl-excel):需手动编译或集成外部工具

网站资源:

https://wiki.tcl-lang.org/page/tcom

---END---

相关推荐
Ruiery22 分钟前
Linux 6.6内核内存管理深度解析(十七):vmalloc — 内核要“虚拟连续“就够:物理页逐个凑,页表来连
linux·运维·服务器
像风一样自由202022 分钟前
2.如何用FastAPI把一个Python算法封装成HTTP服务
python·算法·fastapi
Escalating_xu28 分钟前
【Linux 网络编程】ARP 的具体过程与 ARP 欺骗:一条 IP → MAC 映射,怎样改变数据的去向?
linux·网络·tcp/ip
青少儿编程课堂29 分钟前
蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级:字典树前缀树与单词检索统计
c++·python·算法·bfs·信息学竞赛
田里的水稻29 分钟前
FA_CNN卷积神经网络十八---感知机到多层感知机PyTorch
人工智能·pytorch·python
坚定的共产主义生产设备永不宕机1 小时前
服务器从裸机开始搭建ESXI虚拟机
linux·服务器·网络
終不似少年遊*1 小时前
【Skill】为中型研发团队制作的敏捷迭代AI副驾Skill
人工智能·python·华为云·agent·ai编程·skill
呆萌的代Ma1 小时前
python使用ThreadPoolExecutor自带队列将多线程变串行执行
python
刚入门的大一新生1 小时前
Linux-线程封装
linux·运维·服务器
god_cvz1 小时前
实践:Linux环境构建CTB工具(cesium-terrain-builder)
linux·gis·ctb