It dumps the xlsx file to console and I was using "grep" to search words or IP or whatever you want . May be you can get something else:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# with a "grep" in terminal you can search words in a excel | |
use strict; | |
use warnings; | |
use Text::Iconv; | |
my $converter = Text::Iconv -> new ("utf-8", "windows-1251"); | |
# Text::Iconv is not really required. | |
# This can be any object with the convert method. Or nothing. | |
use Spreadsheet::XLSX; | |
my $excel = Spreadsheet::XLSX -> new ('/systems/ipaddr.xlsx', $converter); | |
foreach my $sheet (@{$excel -> {Worksheet}}) { | |
printf("Sheet: %s\n", $sheet->{Name}); | |
$sheet -> {MaxRow} ||= $sheet -> {MinRow}; | |
foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { | |
$sheet -> {MaxCol} ||= $sheet -> {MinCol}; | |
printf "\n"; | |
foreach my $col ($sheet -> {MinCol} .. $sheet -> {MaxCol}) { | |
my $cell = $sheet -> {Cells} [$row] [$col]; | |
if ($cell) { | |
# printf("( %s , %s ) => %s\n", $row, $col, $cell -> {Val}); | |
printf("%s ", $cell -> {Val}); | |
} | |
} | |
} | |
} |