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

相关推荐
前端开发张小七几秒前
每日一练:3统计数组中相等且可以被整除的数对
前端·python
程序员总部1 分钟前
Python正则表达式有哪些常用匹配字符?
python·mysql·正则表达式
天天进步20157 分钟前
Python项目--基于Python的自然语言处理文本摘要系统
开发语言·python·自然语言处理
小麦果汁吨吨吨20 分钟前
Flask快速入门
后端·python·flask
流云一号24 分钟前
Python实现贪吃蛇三
开发语言·前端·python
小白教程27 分钟前
如何处理Python爬取视频时的反爬机制?
开发语言·python·音视频·python爬虫
热爱编程的OP1 小时前
Numpy常用库方法总结
开发语言·python·numpy
cliffordl1 小时前
ReportLab 导出 PDF(文档创建)
开发语言·python·pdf
纪元A梦1 小时前
华为OD机试真题——跳格子3(2025A卷:200分)Java/python/JavaScript/C++/C语言/GO六种最佳实现
java·javascript·c++·python·华为od·go·华为od机试题
洁✘1 小时前
shell编程正则表达式与文本处理器
linux·运维·正则表达式