Hello community,
here is the log from the commit of package perl-Spreadsheet-Read for
openSUSE:Factory checked in at 2018-02-09 15:47:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Spreadsheet-Read (Old)
and /work/SRC/openSUSE:Factory/.perl-Spreadsheet-Read.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Spreadsheet-Read"
Fri Feb 9 15:47:52 2018 rev:13 rq:574017 version:0.78
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Spreadsheet-Read/perl-Spreadsheet-Read.changes
2018-01-23 13:53:11.617041770 +0100
+++
/work/SRC/openSUSE:Factory/.perl-Spreadsheet-Read.new/perl-Spreadsheet-Read.changes
2018-02-09 15:47:59.654425487 +0100
@@ -1,0 +2,6 @@
+Thu Feb 8 06:09:34 UTC 2018 - [email protected]
+
+- updated to 0.78
+ see /usr/share/doc/packages/perl-Spreadsheet-Read/
+
+-------------------------------------------------------------------
Old:
----
Spreadsheet-Read-0.74.tgz
New:
----
Spreadsheet-Read-0.78.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Spreadsheet-Read.spec ++++++
--- /var/tmp/diff_new_pack.bnEF8T/_old 2018-02-09 15:48:00.750386130 +0100
+++ /var/tmp/diff_new_pack.bnEF8T/_new 2018-02-09 15:48:00.754385986 +0100
@@ -17,7 +17,7 @@
Name: perl-Spreadsheet-Read
-Version: 0.74
+Version: 0.78
Release: 0
%define cpan_name Spreadsheet-Read
Summary: Read the data from a spreadsheet
++++++ Spreadsheet-Read-0.74.tgz -> Spreadsheet-Read-0.78.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/Changes
new/Spreadsheet-Read-0.78/Changes
--- old/Spreadsheet-Read-0.74/Changes 2017-08-27 15:45:47.000000000 +0200
+++ new/Spreadsheet-Read-0.78/Changes 2018-01-29 17:40:14.000000000 +0100
@@ -1,3 +1,25 @@
+0.78 - 29 Jan 2018, H.Merijn Brand
+ * Spreadsheet::ParseExcel supports the active flag as of version 0.61
+ * Fix typo in docs (SPROUT, RT#124214)
+
+0.77 - 22 Jan 2018, H.Merijn Brand
+ * Note possible name clashes with example/tool files
+ * Clipping and stripping more efficient
+
+0.76 - 01 Jan 2018, H.Merijn Brand
+ * Allow streaming in xlscat
+ * Add --dump to xlscat
+ * Add error for opening ODS/SXC from reference
+ * It's 2018
+
+0.75 - 09 Nov 2017, H.Merijn Brand
+ * Windows does not like an exec with arguments that have spaces (PR#15)
+ Three fixes by Andrew Gregory <[email protected]>). Thanks!
+ * Fix column clipping
+ * Manually generate cells to delete when clipping
+ * Skip cell deletion if they were never generated
+ * File names cannot have \0 in newer perls
+
0.74 - 27 Aug 2017, H.Merijn Brand
* Re-enable opening files with bad characters in the filename (issue#14)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/MANIFEST
new/Spreadsheet-Read-0.78/MANIFEST
--- old/Spreadsheet-Read-0.74/MANIFEST 2017-08-27 15:46:33.000000000 +0200
+++ new/Spreadsheet-Read-0.78/MANIFEST 2018-01-29 17:40:46.000000000 +0100
@@ -34,6 +34,7 @@
files/perc.xls
files/perc.xlsx
files/test.csv
+files/test.gnumeric
files/test_m.csv
files/test_m.txt
files/test.ods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/META.json
new/Spreadsheet-Read-0.78/META.json
--- old/Spreadsheet-Read-0.74/META.json 2017-08-27 15:46:34.000000000 +0200
+++ new/Spreadsheet-Read-0.78/META.json 2018-01-29 17:40:46.000000000 +0100
@@ -1,134 +1,134 @@
{
"abstract" : "Meta-Wrapper for reading spreadsheet data",
- "generated_by" : "Author",
"name" : "Spreadsheet-Read",
"prereqs" : {
+ "configure" : {
+ "requires" : {
+ "ExtUtils::MakeMaker" : "0"
+ }
+ },
"test" : {
"requires" : {
"Test::Harness" : "0",
- "Test::More" : "0.88",
- "Test::NoWarnings" : "0"
+ "Test::NoWarnings" : "0",
+ "Test::More" : "0.88"
},
"recommends" : {
- "Test::More" : "1.302086"
+ "Test::More" : "1.302120"
}
},
"runtime" : {
"requires" : {
- "Exporter" : "0",
- "File::Temp" : "0.22",
"Data::Dumper" : "0",
+ "Data::Peek" : "0",
+ "Exporter" : "0",
+ "Carp" : "0",
"perl" : "5.008001",
"Encode" : "0",
- "Data::Peek" : "0",
- "Carp" : "0"
+ "File::Temp" : "0.22"
},
"recommends" : {
- "Data::Peek" : "0.47",
"IO::Scalar" : "0",
- "File::Temp" : "0.2304"
- }
- },
- "configure" : {
- "requires" : {
- "ExtUtils::MakeMaker" : "0"
+ "File::Temp" : "0.2304",
+ "Data::Peek" : "0.47"
}
}
},
+ "resources" : {
+ "license" : [
+ "http://dev.perl.org/licenses/"
+ ],
+ "repository" : {
+ "type" : "git",
+ "web" : "https://github.com/Tux/Spreadsheet-Read",
+ "url" : "https://github.com/Tux/Spreadsheet-Read"
+ }
+ },
+ "provides" : {
+ "Spreadsheet::Read" : {
+ "file" : "Read.pm",
+ "version" : "0.78"
+ }
+ },
+ "license" : [
+ "perl_5"
+ ],
+ "dynamic_config" : 1,
+ "author" : [
+ "H.Merijn Brand <[email protected]>"
+ ],
+ "release_status" : "stable",
"optional_features" : {
- "opt_oo" : {
+ "opt_tools" : {
+ "description" : "Spreadsheet tools",
"prereqs" : {
"runtime" : {
- "requires" : {
- "Spreadsheet::ReadSXC" : "0.20"
+ "recommends" : {
+ "Tk::NoteBook" : "0",
+ "Tk" : "804.034",
+ "Tk::TableMatrix::Spreadsheet" : "0"
}
}
- },
- "description" : "Provides parsing of OpenOffice spreadsheets"
+ }
},
- "opt_excelx" : {
- "description" : "Provides parsing of Microsoft Excel 2007 files",
+ "opt_csv" : {
+ "description" : "Provides parsing of CSV streams",
"prereqs" : {
"runtime" : {
"recommends" : {
- "Spreadsheet::ParseXLSX" : "0.27"
+ "Text::CSV_XS" : "1.34",
+ "Text::CSV_PP" : "1.95",
+ "Text::CSV" : "1.95"
},
"requires" : {
- "Spreadsheet::ParseXLSX" : "0.13",
- "Spreadsheet::ParseExcel::FmtDefault" : "0"
+ "Text::CSV_XS" : "0.71"
}
}
}
},
- "opt_tools" : {
- "description" : "Spreadsheet tools",
+ "opt_oo" : {
+ "description" : "Provides parsing of OpenOffice spreadsheets",
"prereqs" : {
"runtime" : {
- "recommends" : {
- "Tk::TableMatrix::Spreadsheet" : "0",
- "Tk" : "804.034",
- "Tk::NoteBook" : "0"
+ "requires" : {
+ "Spreadsheet::ReadSXC" : "0.20"
}
}
}
},
- "opt_csv" : {
- "description" : "Provides parsing of CSV streams",
+ "opt_excelx" : {
"prereqs" : {
"runtime" : {
"recommends" : {
- "Text::CSV_PP" : "1.95",
- "Text::CSV_XS" : "1.31",
- "Text::CSV" : "1.95"
+ "Spreadsheet::ParseXLSX" : "0.27"
},
"requires" : {
- "Text::CSV_XS" : "0.71"
+ "Spreadsheet::ParseExcel::FmtDefault" : "0",
+ "Spreadsheet::ParseXLSX" : "0.13"
}
}
- }
+ },
+ "description" : "Provides parsing of Microsoft Excel 2007 files"
},
"opt_excel" : {
+ "description" : "Provides parsing of Microsoft Excel files",
"prereqs" : {
"runtime" : {
+ "requires" : {
+ "Spreadsheet::ParseExcel" : "0.34",
+ "Spreadsheet::ParseExcel::FmtDefault" : "0"
+ },
"recommends" : {
"Spreadsheet::ParseExcel" : "0.65"
- },
- "requires" : {
- "Spreadsheet::ParseExcel::FmtDefault" : "0",
- "Spreadsheet::ParseExcel" : "0.34"
}
}
- },
- "description" : "Provides parsing of Microsoft Excel files"
- }
- },
- "dynamic_config" : 1,
- "resources" : {
- "repository" : {
- "url" : "https://github.com/Tux/Spreadsheet-Read",
- "web" : "https://github.com/Tux/Spreadsheet-Read",
- "type" : "git"
- },
- "license" : [
- "http://dev.perl.org/licenses/"
- ]
- },
- "provides" : {
- "Spreadsheet::Read" : {
- "version" : "0.74",
- "file" : "Read.pm"
+ }
}
},
- "author" : [
- "H.Merijn Brand <[email protected]>"
- ],
- "version" : "0.74",
- "license" : [
- "perl_5"
- ],
+ "generated_by" : "Author",
"meta-spec" : {
- "version" : 2,
- "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec"
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : 2
},
- "release_status" : "stable"
+ "version" : "0.78"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/META.yml
new/Spreadsheet-Read-0.78/META.yml
--- old/Spreadsheet-Read-0.74/META.yml 2017-08-27 15:46:34.000000000 +0200
+++ new/Spreadsheet-Read-0.78/META.yml 2018-01-29 17:40:46.000000000 +0100
@@ -35,12 +35,12 @@
provides:
Spreadsheet::Read:
file: Read.pm
- version: '0.74'
+ version: '0.78'
recommends:
Data::Peek: '0.47'
File::Temp: '0.2304'
IO::Scalar: 0
- Test::More: '1.302086'
+ Test::More: '1.302120'
requires:
Carp: 0
Data::Dumper: 0
@@ -55,4 +55,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: https://github.com/Tux/Spreadsheet-Read
-version: '0.74'
+version: '0.78'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/README
new/Spreadsheet-Read-0.78/README
--- old/Spreadsheet-Read-0.74/README 2017-07-30 14:24:09.000000000 +0200
+++ new/Spreadsheet-Read-0.78/README 2018-01-03 16:01:25.000000000 +0100
@@ -47,6 +47,16 @@
$ wget --output-document=Spreadsheet-Read-git.tgz \
'https://github.com/Tux/Spreadsheet-Read/archive/master.tar.gz'
+=head1 TOOLS
+
+Installing this module will optionally (default is yes) also install some
+useful tools that use Spreadsheet::Read. At least two are know to cause a
+possible name clash:
+
+ * xls2csv also exists as https://metacpan.org/release/KEN/xls2csv-1.06
+ Mine existed before that script, and this version dates from 2005
+ * ssdiff also exists in the gnumeric package with similar functionality
+
=head1 TODO
* Make tests for examples/xlscat
@@ -62,7 +72,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2005-2017 H.Merijn Brand
+Copyright (C) 2005-2018 H.Merijn Brand
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/Read.pm
new/Spreadsheet-Read-0.78/Read.pm
--- old/Spreadsheet-Read-0.74/Read.pm 2017-08-27 15:45:47.000000000 +0200
+++ new/Spreadsheet-Read-0.78/Read.pm 2018-01-25 08:11:22.000000000 +0100
@@ -36,7 +36,7 @@
use strict;
use warnings;
-our $VERSION = "0.74";
+our $VERSION = "0.78";
sub Version { $VERSION }
use Carp;
@@ -65,15 +65,16 @@
[ dmp => "Data::Peek", "" ],
);
my %can = map {
- my $preset = $ENV{"SPREADSHEET_READ_\U$_->[0]"};
+ my $p = $_;
+ my $preset = $ENV{"SPREADSHEET_READ_\U$p->[0]"};
if ($preset and $preset =~ m/^[\w:]+$/) {
if (eval "require $preset" and not $@) {
# forcing a parser should still check the version
- for (grep { $_->[1] eq $preset and $_->[2] } @parsers) {
+ for (grep { $p->[1] eq $preset and $p->[2] } @parsers) {
my $ok;
my $has = $preset->VERSION;
$has =~ s/_[0-9]+$//; # Remove beta-part
- if ($_->[2] =~ m/^v([0-9.]+)/) { # clumsy versions
+ if ($p->[2] =~ m/^v([0-9.]+)/) { # clumsy versions
my @min = split m/\./ => $1;
$has =~ s/^v//;
my @has = split m/\./ => $has;
@@ -81,7 +82,7 @@
(($min[0] * 1000 + $min[1]) * 1000 + $min[2]);
}
else { # normal versions
- $ok = $has >= $_->[2];
+ $ok = $has >= $p->[2];
}
$ok or $preset = "!$preset";
}
@@ -90,7 +91,7 @@
$preset = "!$preset";
}
}
- $_->[0] => $preset || "";
+ $p->[0] => $preset || "";
} @parsers;
for (@parsers) {
my ($flag, $mod, $vsn) = @$_;
@@ -282,21 +283,63 @@
sub _clipsheets {
my ($opt, $ref) = @_;
- foreach my $sheet (1 .. $ref->[0]{sheets}) {
- $ref->[$sheet]{indx} = $sheet;
- if (my $s = $opt->{strip} and $ref->[0]{sheets}) {
+ $ref->[0]{sheets} or return $ref;
+
+ my ($rc, $cl) = ($opt->{rc}, $opt->{cells});
+ my ($oc, $os, $oa) = ($opt->{clip}, $opt->{strip}, $opt->{attr});
+
+ # Strip leading/trailing spaces
+ if ($os || $oc) {
+ foreach my $sheet (1 .. $ref->[0]{sheets}) {
+ $ref->[$sheet]{indx} = $sheet;
my $ss = $ref->[$sheet];
$ss->{maxrow} && $ss->{maxcol} or next;
+ my ($mc, $mr) = (0, 0);
foreach my $row (1 .. $ss->{maxrow}) {
foreach my $col (1 .. $ss->{maxcol}) {
- for (($opt->{rc} ? $ss->{cell} [$col][$row] : ()),
- ($opt->{cells} ? $ss->{cr2cell ($col, $row)} : ())) {
- defined or next;
- $s & 2 and s/\s+$//;
- $s & 1 and s/^\s+//;
+ if ($rc) {
+ defined $ss->{cell}[$col][$row] or next;
+ $os & 2 and $ss->{cell}[$col][$row] =~ s/\s+$//;
+ $os & 1 and $ss->{cell}[$col][$row] =~ s/^\s+//;
+ if (length $ss->{cell}[$col][$row]) {
+ $col > $mc and $mc = $col;
+ $row > $mr and $mr = $row;
+ }
}
+ if ($cl) {
+ my $cell = cr2cell ($col, $row);
+ defined $ss->{$cell} or next;
+ $os & 2 and $ss->{$cell} =~ s/\s+$//;
+ $os & 1 and $ss->{$cell} =~ s/^\s+//;
+ if (length $ss->{$cell}) {
+ $col > $mc and $mc = $col;
+ $row > $mr and $mr = $row;
+ }
+ }
+ }
+ }
+
+ $oc && ($mc < $ss->{maxcol} || $mr < $ss->{maxrow}) or next;
+
+ # Remove trailing empty columns
+ foreach my $col (($mc + 1) .. $ss->{maxcol}) {
+ $rc and undef $ss->{cell}[$col];
+ $oa and undef $ss->{attr}[$col];
+ $cl or next;
+ my $c = col2label ($col);
+ delete $ss->{"$c$_"} for 1 .. $ss->{maxrow};
+ }
+
+ # Remove trailing empty rows
+ foreach my $row (($mr + 1) .. $ss->{maxrow}) {
+ foreach my $col (1 .. $mc) {
+ $cl and delete $ss->{cr2cell ($col, $row)};
+ $rc and undef $ss->{cell} [$col][$row];
+ $oa and undef $ss->{attr} [$col][$row];
}
}
+
+ ($ss->{maxrow}, $ss->{maxcol}) = ($mr, $mc);
}
}
@@ -319,34 +362,6 @@
}
}
- $opt->{clip} or return $ref;
-
- foreach my $sheet (1 .. $ref->[0]{sheets}) {
- my $ss = $ref->[$sheet];
-
- # Remove trailing empty columns
- while ($ss->{maxcol} and not
- grep { defined && m/\S/ } @{$ss->{cell}[$ss->{maxcol}]}
- ) {
- (my $col = cr2cell ($ss->{maxcol}, 1)) =~ s/1$//;
- my $recol = qr{^$col(?=[0-9]+)$};
- delete $ss->{$_} for grep m/$recol/, keys %{$ss};
- $ss->{maxcol}--;
- }
- $ss->{maxcol} or $ss->{maxrow} = 0;
-
- # Remove trailing empty rows
- while ($ss->{maxrow} and not (
- grep { defined && m/\S/ }
- map { $ss->{cell}[$_][$ss->{maxrow}] }
- 1 .. $ss->{maxcol}
- )) {
- my $rerow = qr{^[A-Z]+$ss->{maxrow}$};
- delete $ss->{$_} for grep m/$rerow/, keys %{$ss};
- $ss->{maxrow}--;
- }
- $ss->{maxrow} or $ss->{maxcol} = 0;
- }
$ref;
} # _clipsheets
@@ -398,7 +413,8 @@
my $_parser = _parser ($opt{parser});
my $io_ref = ref ($txt) =~ m/GLOB|IO/ ? $txt : undef;
- my $io_fil = $io_ref ? 0 : do { no warnings "newline"; -f $txt };
+ my $io_fil = $io_ref ? 0 : $txt =~ m/\0/ ? 0
+ : do { no warnings "newline"; -f $txt };
my $io_txt = $io_ref || $io_fil ? 0 : 1;
$io_fil && ! -s $txt and return;
@@ -833,6 +849,9 @@
if ($opt{parser} ? _parser ($opt{parser}) eq "sxc"
: ($txt =~ m/^<\?xml/ or -f $txt)) {
$can{sxc} or croak "Spreadsheet::ReadSXC not installed";
+ ref $txt and
+ croak ("Sorry, references as input are not (yet) supported by
Spreadsheet::ReadSXC");
+
my $using = "using $can{sxc}-" . $can{sxc}->VERSION;
my $sxc_options = { %parser_opts, OrderBySheet => 1 }; # New interface
0.20 and up
my $sxc;
@@ -1205,11 +1224,9 @@
=item clip
If set, L<C<ReadData>|/ReadData> will remove all trailing rows and columns
-per sheet that have no visual data. If a sheet has no data at all, the
-sheet will be skipped entirely when this attribute is true.
-
-This option is only valid if L<C<cells>|/cells> is true. The default value
-is true if L<C<cells>|/cells> is true, and false otherwise.
+per sheet that have no data, where no data means only undefined or empty
+cells (after optional stripping). If a sheet has no data at all, the sheet
+will be skipped entirely when this attribute is true.
=item strip
@@ -1415,7 +1432,7 @@
With named sheets will first try to use the list of sheet-labels as stored in
the control structure. If no match is found, it will scan the actual labels
-of the sheets. In that case, it will return the fist matching sheet.
+of the sheets. In that case, it will return the first matching sheet.
If defined, the returned sheet will be of class C<Spreadsheet::Read::Sheet>.
@@ -1542,7 +1559,8 @@
Returns 1 if the selected sheet is active, otherwise returns 0.
-Currently only works on XLS. CSV is always active.
+Currently only works on XLS (as of Spreadsheed::ParseExcel-0.61).
+CSV is always active.
=head2 Using CSV
@@ -1859,6 +1877,26 @@
I consider adding any spreadsheet interface that offers a usable API.
+Under investigation:
+
+=over 2
+
+=item Gnumeric (.gnumeric)
+
+I have seen no existing CPAN module yet.
+
+It is gzip'ed XML
+
+=item Kspread (.ksp)
+
+Now knows as Calligra Sheets.
+
+I have seen no existing CPAN module yet.
+
+It is XML in ZIP
+
+=back
+
=item Alternative parsers for existing formats
As long as the alternative has a good reason for its existence, and the
@@ -1947,7 +1985,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2005-2017 H.Merijn Brand
+Copyright (C) 2005-2018 H.Merijn Brand
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/examples/ss-dups-tk.pl
new/Spreadsheet-Read-0.78/examples/ss-dups-tk.pl
--- old/Spreadsheet-Read-0.74/examples/ss-dups-tk.pl 2017-02-28
18:18:59.000000000 +0100
+++ new/Spreadsheet-Read-0.78/examples/ss-dups-tk.pl 2018-01-01
14:51:00.000000000 +0100
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# ss-dup-tk.pl: Find dups in spreadsheet
-# (m)'09 [23-01-2009] Copyright H.M.Brand 2005-2017
+# (m)'09 [23-01-2009] Copyright H.M.Brand 2005-2018
use strict;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/examples/ss2tk
new/Spreadsheet-Read-0.78/examples/ss2tk
--- old/Spreadsheet-Read-0.74/examples/ss2tk 2017-07-03 13:12:00.000000000
+0200
+++ new/Spreadsheet-Read-0.78/examples/ss2tk 2018-01-01 14:51:06.000000000
+0100
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# ss2tk: show SpreadSheet file in Tk::TableMatrix::Spreadsheet (*)
-# (m)'17 [2017-07-03] Copyright H.M.Brand 2005-2017
+# (m)'17 [2017-07-03] Copyright H.M.Brand 2005-2018
use strict;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/examples/xls2csv
new/Spreadsheet-Read-0.78/examples/xls2csv
--- old/Spreadsheet-Read-0.74/examples/xls2csv 2017-06-07 12:18:22.000000000
+0200
+++ new/Spreadsheet-Read-0.78/examples/xls2csv 2018-01-01 14:51:07.000000000
+0100
@@ -1,7 +1,7 @@
#!/pro/bin/perl
# xls2csv: Convert Microsoft Excel spreadsheet to CSV
-# (m)'17 [07-06-2017] Copyright H.M.Brand 2008-2017
+# (m)'17 [07-06-2017] Copyright H.M.Brand 2008-2018
use strict;
use warnings;
@@ -73,4 +73,5 @@
warn "Converting $xls to $csv ...\n";
open STDOUT, ">", $csv or die "$csv: $!\n";
-exec "xlscat", "-c", @ARGV, $xls;
+$^O eq "MSWin32" and $xls = qq{"$xls"};
+exec { "xlscat" } "xlscat", "-c", @ARGV, $xls;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/examples/xlscat
new/Spreadsheet-Read-0.78/examples/xlscat
--- old/Spreadsheet-Read-0.74/examples/xlscat 2017-07-29 15:43:06.000000000
+0200
+++ new/Spreadsheet-Read-0.78/examples/xlscat 2018-01-01 14:51:13.000000000
+0100
@@ -2,12 +2,12 @@
# xlscat: show XLS/SXC file as Text
# xlsgrep: grep pattern
-# (m)'17 [2017-07-29] Copyright H.M.Brand 2005-2017
+# (m)'17 [2017-11-30] Copyright H.M.Brand 2005-2018
use strict;
use warnings;
-our $VERSION = "3.11";
+our $VERSION = "3.12";
my $is_grep = $0 =~ m/grep$/;
@@ -45,6 +45,7 @@
" optionally skip <skip> (header) lines\n",
" -A Show field attributes in ANSI escapes\n",
" -h[#] Show # header lines\n",
+ " -D Dump each record with Data::Peek or Data::Dumper\n",
$is_grep ? (
" Grep options:\n",
" -i Ignore case\n",
@@ -80,16 +81,9 @@
use Getopt::Long qw(:config bundling noignorecase passthrough);
my $opt_c; # Generate CSV
my $opt_F = ""; # Fields to print
-my $opt_i = 0; # Index (cat) | ignore_case (grep)
-my $opt_L = 0; # Auto-size/align columns
-my $opt_u = 0; # Show unformatted values
-my $opt_f = 0; # Show the formula instead of the value
my $opt_v = 0; # Verbosity for xlscat
my $opt_d = 0; # Debug level for Spreadsheet::Read
-my $opt_A = 0; # Show field colors in ANSI escapes
-my $opt_H = 0; # Output in HTML
my $opt_h = 0; # Number of header lines for grep or -L
-my $opt_w = 0; # Grep words
my $clip = 1;
my $enc_i; # Input encoding
my $enc_o; # Output encoding
@@ -106,12 +100,12 @@
# Input XLS
"dtfmt".
"|date-format=s" => \my $dtfmt, # Default date-format for Excel
- "f|formulas!" => \$opt_f,
+ "f|formulas!" => \my $opt_f, # Show the formula instead of the value
"password=s" => \my $passwd, # For encrypted spreadsheets
# Output
"i|index".
- "|ignore-case" => \$opt_i,
+ "|ignore-case!" => \my $opt_i, # Index (cat) | ignore_case (grep)
"s|separator".
"|outsepchar".
"|out-sep".
@@ -119,15 +113,16 @@
"S|sheets=s" => \my $opt_S, # Sheets to print
"R|rows=s" => \my $opt_R, # Rows to print
"C|columns=s" => \my $opt_C, # Columns to print
- "F|fields=s" => \$opt_F,
- "L|fit|align!" => \$opt_L,
+ "F|fields=s" => \ $opt_F,
+ "L|fit|align!" => \my $opt_L, # Auto-size/align columns
"P|pivot!" => \my $pivot,
"n|number:0" => \my $opt_n, # Prefix lines with column number
- "A|ansi|color!" => \$opt_A,
- "u|unformatted!" => \$opt_u,
+ "A|ansi|color!" => \my $opt_A, # Show field colors in ANSI escapes
+ "u|unformatted!" => \my $opt_u, # Show unformatted values
"v|verbose:1" => \$opt_v,
"d|debug:1" => \$opt_d,
- "H|html:1" => \$opt_H,
+ "D|dump!" => \my $opt_D, # Use Data::Peek or Data::Dumper
+ "H|html:1" => \my $opt_H, # Output in HTML
"noclip" => sub { $clip = 0 },
"strip:3" => \my $strip,
"sort=s" => \my $sort_order,
@@ -139,7 +134,7 @@
"U|utf-8|utf8" => sub { $enc_o = "utf-8" },
# Grep
- "w|word!" => \$opt_w,
+ "w|word!" => \my $opt_w, # Grep words
"h|header:1" => \$opt_h,
) or usage 1, "GetOpt: $@";
@@ -161,7 +156,7 @@
defined $opt_s or $opt_s = "|"; eval "\$opt_s = qq{$opt_s}";
defined $opt_S or $opt_S = $opt_i || $is_grep ? "all" : "1";
$opt_i && !$is_grep && $opt_v < 1 and $opt_v = 1;
-$opt_f and $opt_A++;
+$opt_f and $opt_A = 1;
if ($opt_c) {
$opt_L = 0; # Cannot align CSV
@@ -203,10 +198,16 @@
$opt_v > 1 and warn "Matching on $pattern\n";
}
-@ARGV or usage 1;
my $file = shift;
--f $file or usage 1, "the file argument is not a regular file";
--s $file or usage 1, "the file is empty";
+if (defined $file and $file ne "-") {
+ $opt_v > 1 and warn "Using $file as input\n";
+ -f $file or usage 1, "the file argument is not a regular file";
+ -s $file or usage 1, "the file is empty";
+ }
+else {
+ $opt_v > 1 and warn "Working as a pipe\n";
+ $file = *ARGV;
+ }
use Encode qw( encode decode );
use Spreadsheet::Read;
@@ -413,6 +414,10 @@
exists $print{col} and @row = @row[grep{$_<@row}@{$print{col}}];
$is_grep && $r > $opt_h &&
! grep { defined $_ && $_ =~ $pattern } @row and next;
+ if ($opt_D) {
+ ddumper \@row;
+ next;
+ }
if ($opt_L) {
foreach my $c (0 .. $#row) {
my $l = length $row[$c];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/files/blank.csv
new/Spreadsheet-Read-0.78/files/blank.csv
--- old/Spreadsheet-Read-0.74/files/blank.csv 2012-02-14 08:19:26.000000000
+0100
+++ new/Spreadsheet-Read-0.78/files/blank.csv 2018-01-22 09:10:47.000000000
+0100
@@ -1,3 +1,3 @@
-,,,
+ ,,,
,,,
,,,
Binary files old/Spreadsheet-Read-0.74/files/test.gnumeric and
new/Spreadsheet-Read-0.78/files/test.gnumeric differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/200_csv.t
new/Spreadsheet-Read-0.78/t/200_csv.t
--- old/Spreadsheet-Read-0.74/t/200_csv.t 2017-03-22 17:07:17.000000000
+0100
+++ new/Spreadsheet-Read-0.78/t/200_csv.t 2018-01-22 09:13:24.000000000
+0100
@@ -3,7 +3,7 @@
use strict;
use warnings;
-my $tests = 168;
+my $tests = 206;
use Test::More;
require Test::NoWarnings;
@@ -91,21 +91,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.csv", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.csv has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.csv", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.csv", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 3");
+ is ($ref->[1]{maxcol}, 1, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/205_csv.t
new/Spreadsheet-Read-0.78/t/205_csv.t
--- old/Spreadsheet-Read-0.74/t/205_csv.t 2017-01-21 16:11:49.000000000
+0100
+++ new/Spreadsheet-Read-0.78/t/205_csv.t 2018-01-22 09:15:08.000000000
+0100
@@ -5,7 +5,7 @@
# OO version of 200_csv.t
-my $tests = 223;
+my $tests = 261;
use Test::More;
require Test::NoWarnings;
@@ -142,21 +142,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = Spreadsheet::Read->new ("files/blank.csv", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.csv has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.csv", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = Spreadsheet::Read->new ("files/blank.csv", strip => 1, cells =>
0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = Spreadsheet::Read->new ("files/blank.csv", strip => 1,
rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 3");
+ is ($ref->[1]{maxcol}, 1, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = Spreadsheet::Read->new ("files/blank.csv", strip => 1, cells =>
0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/210_csv.t
new/Spreadsheet-Read-0.78/t/210_csv.t
--- old/Spreadsheet-Read-0.74/t/210_csv.t 2015-06-25 18:38:58.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/210_csv.t 2018-01-22 09:17:41.000000000
+0100
@@ -5,7 +5,7 @@
BEGIN { $ENV{SPREADSHEET_READ_CSV} = "Text::CSV_XS"; }
-my $tests = 133;
+my $tests = 171;
use Test::More;
require Test::NoWarnings;
@@ -93,21 +93,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.csv", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.csv has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.csv", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.csv", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 3");
+ is ($ref->[1]{maxcol}, 1, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/220_csv.t
new/Spreadsheet-Read-0.78/t/220_csv.t
--- old/Spreadsheet-Read-0.74/t/220_csv.t 2015-06-25 18:39:17.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/220_csv.t 2018-01-22 09:20:06.000000000
+0100
@@ -5,7 +5,7 @@
BEGIN { $ENV{SPREADSHEET_READ_CSV} = "Text::CSV_PP"; }
-my $tests = 133;
+my $tests = 171;
use Test::More;
require Test::NoWarnings;
@@ -93,21 +93,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.csv", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.csv has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.csv", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.csv", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.csv", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 3, "maxrow 3");
+ is ($ref->[1]{maxcol}, 4, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 3");
+ is ($ref->[1]{maxcol}, 1, "maxcol 4");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.csv", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.csv", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 0");
+ is ($ref->[1]{maxcol}, 0, "maxcol 0");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/30_xls.t
new/Spreadsheet-Read-0.78/t/30_xls.t
--- old/Spreadsheet-Read-0.74/t/30_xls.t 2015-06-13 12:04:34.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/30_xls.t 2018-01-22 09:25:31.000000000
+0100
@@ -10,7 +10,7 @@
my $parser;
if ($parser = Spreadsheet::Read::parses ("xls")) {
print STDERR "# Parser: $parser-", $parser->VERSION, "\n";
- plan tests => 234;
+ plan tests => 272;
Test::NoWarnings->import;
}
else {
@@ -148,21 +148,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.xls", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.xls has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.xls", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 2, "maxrow 2");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.xls", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 2, "maxrow 2");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xls", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.xls", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 2, "maxrow 2");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.xls", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.xls", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 2, "maxrow 2");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.xls", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 2, "maxrow 2");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.xls", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.xls", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xls", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xls", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xls", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xls", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/33_misc.t
new/Spreadsheet-Read-0.78/t/33_misc.t
--- old/Spreadsheet-Read-0.74/t/33_misc.t 2012-05-31 09:06:10.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/33_misc.t 2018-01-22 09:34:30.000000000
+0100
@@ -39,7 +39,7 @@
);
}
ok ($xls, "Open with options");
-is (0+@{ $xls->[1]{cell}[1]}, 0, "undef works as option value for 'rc'");
+is ($xls->[1]{cell}[1], undef, "undef works as option value for 'rc'");
ok (!exists $xls->[1]{A1}, "undef works as option value for
'cells'");
{ local *STDERR; # We want the debug activated, but not shown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/36_xls.t
new/Spreadsheet-Read-0.78/t/36_xls.t
--- old/Spreadsheet-Read-0.74/t/36_xls.t 2017-05-25 21:46:14.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/36_xls.t 2018-01-23 15:52:17.000000000
+0100
@@ -149,9 +149,13 @@
# Test extended attributes (active)
ok ($xls = Spreadsheet::Read->new ("files/Active2.xls", attr => 1), "Active
sheet");
is ($xls->sheets, 3, "Book has 3 sheets");
-is ($xls->sheet (1)->{active}, 0, "Sheet 1 is not active");
-is ($xls->[2]{active}, 1, "Sheet 2 is active");
-is ($xls->sheet (3)->active, 0, "Sheet 3 is not active");
+SKIP: {
+ my $v = $xls->[0]{version};
+ $v < 0.61 and skip "$xls->[0]{parser}-$v does not support the active
flag", 3;
+ is ($xls->sheet (1)->{active}, 0, "Sheet 1 is not active");
+ is ($xls->[2]{active}, 1, "Sheet 2 is active");
+ is ($xls->sheet (3)->active, 0, "Sheet 3 is not active");
+ }
is ($xls->sheet (1)->attr ("A1")->{type}, "text", "Attr through method A1");
is ($xls->sheet (1)->attr (2, 2)->{type}, "text", "Attr through method B2");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/50_sc.t
new/Spreadsheet-Read-0.78/t/50_sc.t
--- old/Spreadsheet-Read-0.74/t/50_sc.t 2009-03-29 17:39:38.000000000 +0200
+++ new/Spreadsheet-Read-0.78/t/50_sc.t 2018-01-22 09:53:36.000000000 +0100
@@ -33,7 +33,7 @@
foreach my $txt ("files/test.sc", $content) {
foreach my $clip (0, 2) {
my $sc;
- ok ($sc = ReadData ($txt, clip => $clip),
+ ok ($sc = ReadData ($txt, clip => $clip, strip => 2),
"Read/Parse sc file ".($clip?"clipped":"unclipped"));
ok (1, "Base values");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/51_sc.t
new/Spreadsheet-Read-0.78/t/51_sc.t
--- old/Spreadsheet-Read-0.74/t/51_sc.t 2016-11-27 12:25:51.000000000 +0100
+++ new/Spreadsheet-Read-0.78/t/51_sc.t 2018-01-22 09:54:35.000000000 +0100
@@ -36,7 +36,7 @@
foreach my $clip (0, 2) {
my $sc;
- ok ($sc = ReadDataStream ("files/test.sc", clip => $clip),
+ ok ($sc = ReadDataStream ("files/test.sc", clip => $clip, strip => 2),
"Read/Parse sc file ".($clip?"clipped":"unclipped"));
ok (1, "Base values");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/600_xlsx.t
new/Spreadsheet-Read-0.78/t/600_xlsx.t
--- old/Spreadsheet-Read-0.74/t/600_xlsx.t 2015-09-14 18:40:27.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/600_xlsx.t 2018-01-22 09:43:22.000000000
+0100
@@ -3,7 +3,7 @@
use strict;
use warnings;
-my $tests = 78;
+my $tests = 116;
use Test::More;
require Test::NoWarnings;
@@ -88,21 +88,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.xlsx", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.xlsx has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/603_misc.t
new/Spreadsheet-Read-0.78/t/603_misc.t
--- old/Spreadsheet-Read-0.74/t/603_misc.t 2015-06-25 18:41:08.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/603_misc.t 2018-01-22 09:41:23.000000000
+0100
@@ -39,7 +39,7 @@
);
}
ok ($xls, "Open with options");
-is (0+@{ $xls->[1]{cell}[1]}, 0, "undef works as option value for 'rc'");
+is ($xls->[1]{cell}[1], undef, "undef works as option value for 'rc'");
ok (!exists $xls->[1]{A1}, "undef works as option value for
'cells'");
unless ($ENV{AUTOMATED_TESTING}) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/610_xlsx.t
new/Spreadsheet-Read-0.78/t/610_xlsx.t
--- old/Spreadsheet-Read-0.74/t/610_xlsx.t 2017-05-22 13:29:29.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/610_xlsx.t 2018-01-22 09:03:25.000000000
+0100
@@ -5,7 +5,7 @@
BEGIN { $ENV{SPREADSHEET_READ_XLSX} = "Spreadsheet::ParseXLSX"; }
-my $tests = 78;
+my $tests = 116;
use Test::More;
require Test::NoWarnings;
@@ -92,21 +92,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.xlsx", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.xlsx has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/613_misc.t
new/Spreadsheet-Read-0.78/t/613_misc.t
--- old/Spreadsheet-Read-0.74/t/613_misc.t 2015-06-25 18:40:14.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/613_misc.t 2018-01-22 09:48:10.000000000
+0100
@@ -41,7 +41,7 @@
);
}
ok ($xls, "Open with options");
-is (0+@{ $xls->[1]{cell}[1]}, 0, "undef works as option value for 'rc'");
+is ($xls->[1]{cell}[1], undef, "undef works as option value for 'rc'");
ok (!exists $xls->[1]{A1}, "undef works as option value for
'cells'");
unless ($ENV{AUTOMATED_TESTING}) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/620_xlsx.t
new/Spreadsheet-Read-0.78/t/620_xlsx.t
--- old/Spreadsheet-Read-0.74/t/620_xlsx.t 2015-06-25 18:40:19.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/620_xlsx.t 2018-01-22 09:49:41.000000000
+0100
@@ -5,7 +5,7 @@
BEGIN { $ENV{SPREADSHEET_READ_XLSX} = "Spreadsheet::XLSX"; }
-my $tests = 78;
+my $tests = 116;
use Test::More;
require Test::NoWarnings;
@@ -90,21 +90,67 @@
}
}
-{ # RT#105197 - Strip wrong selection
- my $ref = ReadData ("files/blank.xlsx", strip => 1);
- ok ($ref, "strip cells 1 rc 1");
+# blank.xlsx has only one sheet with A1 filled with ' '
+{ my $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 0);
+ ok ($ref, "!clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0);
- ok ($ref, "strip cells 0 rc 1");
+ is ($ref->[1]{A1}, "", "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 1, cells => 0);
+ ok ($ref, "!clip strip 1");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
is ($ref->[1]{cell}[1][1], "", "blank (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, rc => 0);
- ok ($ref, "strip cells 1 rc 0");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 2,
rc => 0);
+ ok ($ref, "!clip strip 2");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, "", "blank A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 0, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, "!clip strip 3");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 0);
+ ok ($ref, " clip strip 0");
+ is ($ref->[1]{maxrow}, 1, "maxrow 1");
+ is ($ref->[1]{maxcol}, 1, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], " ", "(1, 1) = ' '");
+ is ($ref->[1]{A1}, " ", "A1 = ' '");
+
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
- is ($ref->[1]{A1}, "", "blank A1");
- $ref = ReadData ("files/blank.xlsx", strip => 1, cells => 0, rc => 0);
- ok ($ref, "strip cells 0 rc 0");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 1, cells => 0);
+ ok ($ref, " clip strip 1");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 2,
rc => 0);
+ ok ($ref, " clip strip 2");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
+ is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
+ is ($ref->[1]{A1}, undef, "undef A1");
+ $ref = ReadData ("files/blank.xlsx", clip => 1, strip => 3, cells => 0,
rc => 0);
+ ok ($ref, " clip strip 3");
+ is ($ref->[1]{maxrow}, 0, "maxrow 1");
+ is ($ref->[1]{maxcol}, 0, "maxcol 1");
is ($ref->[1]{cell}[1][1], undef, "undef (1, 1)");
is ($ref->[1]{A1}, undef, "undef A1");
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Spreadsheet-Read-0.74/t/623_misc.t
new/Spreadsheet-Read-0.78/t/623_misc.t
--- old/Spreadsheet-Read-0.74/t/623_misc.t 2015-06-25 18:40:22.000000000
+0200
+++ new/Spreadsheet-Read-0.78/t/623_misc.t 2018-01-22 09:45:17.000000000
+0100
@@ -41,7 +41,7 @@
);
}
ok ($xls, "Open with options");
-is (0+@{ $xls->[1]{cell}[1]}, 0, "undef works as option value for 'rc'");
+is ($xls->[1]{cell}[1], undef, "undef works as option value for 'rc'");
ok (!exists $xls->[1]{A1}, "undef works as option value for
'cells'");
unless ($ENV{AUTOMATED_TESTING}) {
++++++ nonstdperlpath.patch ++++++
--- /var/tmp/diff_new_pack.bnEF8T/_old 2018-02-09 15:48:00.882381389 +0100
+++ /var/tmp/diff_new_pack.bnEF8T/_new 2018-02-09 15:48:00.886381246 +0100
@@ -1,51 +1,57 @@
-diff -Naur Spreadsheet-Read-0.74/Read.pm Spreadsheet-Read-0.74-new/Read.pm
---- Spreadsheet-Read-0.74/Read.pm 2017-08-27 09:45:47.000000000 -0400
-+++ Spreadsheet-Read-0.74-new/Read.pm 2017-10-18 17:43:25.174589145 -0400
+Index: Spreadsheet-Read-0.78/Read.pm
+===================================================================
+--- Spreadsheet-Read-0.78.orig/Read.pm
++++ Spreadsheet-Read-0.78/Read.pm
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
package Spreadsheet::Read;
-diff -Naur Spreadsheet-Read-0.74/examples/ss-dups-tk.pl
Spreadsheet-Read-0.74-new/examples/ss-dups-tk.pl
---- Spreadsheet-Read-0.74/examples/ss-dups-tk.pl 2017-02-28
12:18:59.000000000 -0500
-+++ Spreadsheet-Read-0.74-new/examples/ss-dups-tk.pl 2017-10-18
17:42:53.064862460 -0400
+Index: Spreadsheet-Read-0.78/examples/ss-dups-tk.pl
+===================================================================
+--- Spreadsheet-Read-0.78.orig/examples/ss-dups-tk.pl
++++ Spreadsheet-Read-0.78/examples/ss-dups-tk.pl
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
# ss-dup-tk.pl: Find dups in spreadsheet
- # (m)'09 [23-01-2009] Copyright H.M.Brand 2005-2017
-diff -Naur Spreadsheet-Read-0.74/examples/ss2tk
Spreadsheet-Read-0.74-new/examples/ss2tk
---- Spreadsheet-Read-0.74/examples/ss2tk 2017-07-03 07:12:00.000000000
-0400
-+++ Spreadsheet-Read-0.74-new/examples/ss2tk 2017-10-18 17:42:53.064862460
-0400
+ # (m)'09 [23-01-2009] Copyright H.M.Brand 2005-2018
+Index: Spreadsheet-Read-0.78/examples/ss2tk
+===================================================================
+--- Spreadsheet-Read-0.78.orig/examples/ss2tk
++++ Spreadsheet-Read-0.78/examples/ss2tk
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
# ss2tk: show SpreadSheet file in Tk::TableMatrix::Spreadsheet (*)
- # (m)'17 [2017-07-03] Copyright H.M.Brand 2005-2017
-diff -Naur Spreadsheet-Read-0.74/examples/ssdiff
Spreadsheet-Read-0.74-new/examples/ssdiff
---- Spreadsheet-Read-0.74/examples/ssdiff 2016-11-27 06:28:35.000000000
-0500
-+++ Spreadsheet-Read-0.74-new/examples/ssdiff 2017-10-18 17:42:53.064862460
-0400
+ # (m)'17 [2017-07-03] Copyright H.M.Brand 2005-2018
+Index: Spreadsheet-Read-0.78/examples/ssdiff
+===================================================================
+--- Spreadsheet-Read-0.78.orig/examples/ssdiff
++++ Spreadsheet-Read-0.78/examples/ssdiff
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
use strict;
use warnings;
-diff -Naur Spreadsheet-Read-0.74/examples/xls2csv
Spreadsheet-Read-0.74-new/examples/xls2csv
---- Spreadsheet-Read-0.74/examples/xls2csv 2017-06-07 06:18:22.000000000
-0400
-+++ Spreadsheet-Read-0.74-new/examples/xls2csv 2017-10-18 17:42:53.064862460
-0400
+Index: Spreadsheet-Read-0.78/examples/xls2csv
+===================================================================
+--- Spreadsheet-Read-0.78.orig/examples/xls2csv
++++ Spreadsheet-Read-0.78/examples/xls2csv
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl
# xls2csv: Convert Microsoft Excel spreadsheet to CSV
- # (m)'17 [07-06-2017] Copyright H.M.Brand 2008-2017
-diff -Naur Spreadsheet-Read-0.74/examples/xlscat
Spreadsheet-Read-0.74-new/examples/xlscat
---- Spreadsheet-Read-0.74/examples/xlscat 2017-07-29 09:43:06.000000000
-0400
-+++ Spreadsheet-Read-0.74-new/examples/xlscat 2017-10-18 17:42:53.068862177
-0400
+ # (m)'17 [07-06-2017] Copyright H.M.Brand 2008-2018
+Index: Spreadsheet-Read-0.78/examples/xlscat
+===================================================================
+--- Spreadsheet-Read-0.78.orig/examples/xlscat
++++ Spreadsheet-Read-0.78/examples/xlscat
@@ -1,4 +1,4 @@
-#!/pro/bin/perl
+#!/usr/bin/perl