NAME
Excel::XLSX - Read and write Excel XLSX data
VERSION
version 1.02
SYNOPSIS
use Excel::XLSX qw( from_xlsx to_xlsx );
open( my $in, '<:raw', 'in.xlsx' ) or die $!;
local $/ = undef;
my $xlsx_in = <$in>;
my $workbook_data = from_xlsx($xlsx_in);
$workbook_data->{worksheets}[0]{cells}{12}{7}{value} = 'Hello world!';
my $xlsx = to_xlsx($workbook_data);
open( my $out, '>:raw', 'out.xlsx' ) or die $!;
print $out $xlsx;
DESCRIPTION
This module offers for export 2 functions, from_xlsx
and to_xlsx
, that will read from raw binary Excel XLSX data into a data structure and write from a data structure to raw binary Excel XLSX data.
FUNCTIONS
from_xlsx
Reads from raw binary Excel XLSX data and returns a data structure.
my $workbook_data = from_xlsx($xlsx_in);
to_xlsx
Requires a data structure like what might be returned from from_xlsx
and returns raw binary Excel XLSX data.
my $xlsx = to_xlsx($workbook_data);
DATA STRUCTURE
The data structure is expected to generally look like:
formats:
- font: Arial
size: 12
- font: Arial
size: 10
color: #00FF00
worksheets:
- name: Example Worksheet
cells:
12:
7:
- format_id: 0
value: Hello world!
SEE ALSO
Spreadsheet::ParseXLSX, Excel::Writer::XLSX, Excel::ValueReader::XLSX, Excel::ValueWriter::XLSX.
You can also look for additional information at:
AUTHOR
Gryphon Shafer <gryphon@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2025-2050 by Gryphon Shafer.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)