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---

相关推荐
信安IT租赁13 小时前
小公司服务器的自启动脚本:用 systemd 做成服务,开机自动跑
linux·运维·服务器
陈秋月13 小时前
从一句注释到 root:GoldenEye 靶机通关记录
linux
badhope13 小时前
Agent 说发布成功,文章却 404:我补了 4 张回读收据
后端·python·ai编程
xurileidian13 小时前
第 30 篇 · 边玩边学Python · 猜数字小游戏 把判断循环异常串起来
前端·python·算法
用户960984579224013 小时前
Ubuntu 开发软件全链路美化:VS Code/Cursor/tmux/delta/fzf 实战
linux
南棱笑笑生13 小时前
20261127在RK3576的Android14系统下适配2个以太网卡RTL821F-CG【无外部晶振模式】
linux·服务器·数据库·驱动开发
我命由我1234513 小时前
Excel - Excel 固定列,滚动时该列始终可见
运维·学习·职场和发展·excel·职场发展·运维开发·学习方法
Julien200414 小时前
管理机密(二)
linux·运维·服务器·学习方法
灵析表格14 小时前
灵析表格函数精讲|xml转json:供应商配置转换
xml·json·excel·办公自动化·wps·效率工具·ai办公
派大猩猩_14 小时前
同一份 Excel 多人修改如何避免覆盖?本地编辑与在线共编的冲突机制与恢复
excel·文件同步·网盘·在线编辑·多人在线编辑·excel协同