当前位置: 首页 > news >正文

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

案例:

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—

相关文章:

  • 【Qt】带参数的信号和槽函数
  • HTML嵌入CSS样式超详解(尊享)
  • 《2025年软件测试工程师面试》MySQL面试题
  • 【性能工具】Perfetto中如何分析主线程为何进入sleep状态
  • Week4_250310~250316_OI日志(待完善)
  • PySide(PyQT),QGraphicsRectItem的setPos()和setRect()的坐标位置的区别
  • Dynamics 365 新版的Power apps开发界面中如何找到开发者资源
  • WM_CREATE
  • nndl: chap1_warmup_numpy_tutorial
  • Java高频面试之集合-09
  • 【Python】dash-fastapi前后端搭建
  • QT多线程
  • 初级网工之路: 如何通过服务器进行交换机的配置
  • Faster R-CNN原理详解以及Pytorch实现模型训练与推理
  • 【NexLM 开源系列】让 AI 聊天更丝滑:SSE 实现流式对话!
  • 存储过程和自定义函数在银行信贷业务中的应用(oracle)
  • pop_dialog_state(state: State)弹出对话栈并返回到主助手,让整个对话流程图可以明确追踪对话流,并将控制权委派给特定的子对话图。
  • CHI协议中的read transaction flow
  • UDP-网络编程/socket编程
  • 【K8s】专题十六(3):Kubernetes 包管理工具之 Helm 语法
  • 普京提议重启俄乌直接谈判后,特朗普表态了
  • 佩斯科夫:俄会考虑30天停火提议,但试图对俄施压无用
  • 4月证券私募产品备案量创23个月新高,股票策略占比超六成
  • “降息潮”延续!存款利率全面迈向“1时代”
  • 47本笔记、2341场讲座,一位普通上海老人的阅读史
  • 泽连斯基称与特朗普通话讨论停火事宜