r48855 - in /trunk/libspreadsheet-read-perl: Changes META.yml Read.pm debian/changelog t/24_csv.t
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Wed Dec 16 04:32:12 UTC 2009
Author: jawnsy-guest
Date: Wed Dec 16 04:32:06 2009
New Revision: 48855
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=48855
Log:
* New upstream release
* Add row() and cellrow()
Modified:
trunk/libspreadsheet-read-perl/Changes
trunk/libspreadsheet-read-perl/META.yml
trunk/libspreadsheet-read-perl/Read.pm
trunk/libspreadsheet-read-perl/debian/changelog
trunk/libspreadsheet-read-perl/t/24_csv.t
Modified: trunk/libspreadsheet-read-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/Changes?rev=48855&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/Changes (original)
+++ trunk/libspreadsheet-read-perl/Changes Wed Dec 16 04:32:06 2009
@@ -1,6 +1,11 @@
Revision history for Spreadsheet::Read
-0.37 Thu 09 Nov 2009
+0.38 Tue 15 Dec 2009
+
+ - Add row () and cellrow ()
+ - Updated META.yml to meet most recent specs (optional_features = map)
+
+0.37 Mon 09 Nov 2009
- IO streams improvements
- MANIFEST fix
Modified: trunk/libspreadsheet-read-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/META.yml?rev=48855&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/META.yml (original)
+++ trunk/libspreadsheet-read-perl/META.yml Wed Dec 16 04:32:06 2009
@@ -1,6 +1,6 @@
--- #YAML:1.1
name: Read
-version: 0.37
+version: 0.38
abstract: Meta-Wrapper for reading spreadsheet data
license: perl
author:
@@ -10,7 +10,7 @@
provides:
Spreadsheet::Read:
file: Read.pm
- version: 0.37
+ version: 0.38
requires:
perl: 5.006
Exporter: 0
@@ -34,31 +34,31 @@
version: 1.4
url: http://module-build.sourceforge.net/META-spec-v1.4.html
optional_features:
-- opt_csv:
+ opt_csv:
description: Provides parsing of CSV streams
requires:
Text::CSV_XS: 0.69
recommends:
- Text::CSV: 1.15
- Text::CSV_PP: 1.23
- Text::CSV_XS: 0.69
-- opt_excel:
+ Text::CSV: 1.16
+ Text::CSV_PP: 1.24
+ Text::CSV_XS: 0.70
+ opt_excel:
description: Provides parsing of Microsoft Excel files
requires:
Spreadsheet::ParseExcel: 0.26
Spreadsheet::ParseExcel::FmtDefault: 0
recommends:
- Spreadsheet::ParseExcel: 0.55
-- opt_excelx:
+ Spreadsheet::ParseExcel: 0.56
+ opt_excelx:
description: Provides parsing of Microsoft Excel 2007 files
requires:
Spreadsheet::XLSX: 0.12
Spreadsheet::XLSX::Fmt2007: 0
-- opt_oo:
+ opt_oo:
description: Provides parsing of OpenOffice spreadsheets
requires:
Spreadsheet::ReadSXC: 0.2
-- opt_tools:
+ opt_tools:
description: Spreadsheet tools
recommends:
Tk: 0
Modified: trunk/libspreadsheet-read-perl/Read.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/Read.pm?rev=48855&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/Read.pm (original)
+++ trunk/libspreadsheet-read-perl/Read.pm Wed Dec 16 04:32:06 2009
@@ -23,14 +23,14 @@
use strict;
use warnings;
-our $VERSION = "0.37";
+our $VERSION = "0.38";
sub Version { $VERSION }
use Carp;
use Exporter;
our @ISA = qw( Exporter );
our @EXPORT = qw( ReadData cell2cr cr2cell );
-our @EXPORT_OK = qw( parses rows );
+our @EXPORT_OK = qw( parses rows cellrow row );
use File::Temp qw( );
use Data::Dumper;
@@ -126,6 +126,29 @@
}
($c, $r);
} # cell2cr
+
+# my @row = cellrow ($ss->[1], 1);
+sub cellrow
+{
+ my $sheet = shift or return;
+ ref $sheet eq "HASH" && exists $sheet->{cell} or return;
+ exists $sheet->{maxcol} && exists $sheet->{maxrow} or return;
+ my $row = shift or return;
+ $row > 0 && $row <= $sheet->{maxrow} or return;
+ my $s = $sheet->{cell};
+ map { $s->[$_][$row] } 1..$sheet->{maxcol};
+ } # cellrow
+
+# my @row = row ($ss->[1], 1);
+sub row
+{
+ my $sheet = shift or return;
+ ref $sheet eq "HASH" && exists $sheet->{cell} or return;
+ exists $sheet->{maxcol} && exists $sheet->{maxrow} or return;
+ my $row = shift or return;
+ $row > 0 && $row <= $sheet->{maxrow} or return;
+ map { $sheet->{cr2cell ($_, $row)} } 1..$sheet->{maxcol};
+ } # row
# Convert {cell}'s [column][row] to a [row][column] list
# my @rows = rows ($ss->[1]);
@@ -820,6 +843,28 @@
my ($col, $row) = cell2cr ("D14"); # returns ( 4, 14)
my ($col, $row) = cell2cr ("AB4"); # returns (28, 4)
+=item my @row = row ($ref, $row)
+
+=item my @row = Spreadsheet::Read::row ($ss->[1], 3)
+
+Get full row of formatted values (like C<< $ss->{A3} .. $ss->{G3} >>)
+
+Note that the indexes in the returned list are 0-based.
+
+C<row ()> is not imported by default, so either specify it in the
+use argument list, or call it fully qualified.
+
+=item my @row = cellrow ($ref, $row)
+
+=item my @row = Spreadsheet::Read::cellrow ($ss->[1], 3)
+
+Get full row of unformatted values (like C<< $ss->{cell}[1][3] .. $ss->{cell}[7][3] >>)
+
+Note that the indexes in the returned list are 0-based.
+
+C<cellrow ()> is not imported by default, so either specify it in the
+use argument list, or call it fully qualified.
+
=item my @rows = rows ($ref)
=item my @rows = Spreadsheet::Read::rows ($ss->[1])
Modified: trunk/libspreadsheet-read-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/debian/changelog?rev=48855&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/debian/changelog (original)
+++ trunk/libspreadsheet-read-perl/debian/changelog Wed Dec 16 04:32:06 2009
@@ -1,3 +1,10 @@
+libspreadsheet-read-perl (0.38-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * Add row() and cellrow()
+
+ -- Jonathan Yu <jawnsy at cpan.org> Tue, 15 Dec 2009 20:22:42 -0500
+
libspreadsheet-read-perl (0.37-1) unstable; urgency=low
[ Jonathan Yu ]
Modified: trunk/libspreadsheet-read-perl/t/24_csv.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libspreadsheet-read-perl/t/24_csv.t?rev=48855&op=diff
==============================================================================
--- trunk/libspreadsheet-read-perl/t/24_csv.t (original)
+++ trunk/libspreadsheet-read-perl/t/24_csv.t Wed Dec 16 04:32:06 2009
@@ -3,11 +3,11 @@
use strict;
use warnings;
-my $tests = 116;
+my $tests = 118;
use Test::More;
require Test::NoWarnings;
-use Spreadsheet::Read;
+use Spreadsheet::Read qw( ReadData cell2cr row cellrow );
my $parser = Spreadsheet::Read::parses ("csv") or
plan skip_all => "No CSV parser found";
@@ -52,6 +52,10 @@
is ($csv->[1]{$cell}, "", "Formatted cell $cell");
}
+my @row = ("A3", "", "C3", "D3", (undef) x 15);
+is_deeply ([ row ($csv->[1], 3) ], \@row, "Formatted row 3");
+is_deeply ([ cellrow ($csv->[1], 3) ], \@row, "Unformatted row 3");
+
ok ($csv = ReadDataCSV ("files/test_m.txt"), "Read/Parse M\$ csv file");
ok (1, "Defined fields");
More information about the Pkg-perl-cvs-commits
mailing list