Differences between version 7 and predecessor to the previous major change of Excel2CSV.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 7 | Last edited on Thursday, May 13, 2004 4:32:24 pm | by AristotlePagaltzis | Revert |
Older page: | version 3 | Last edited on Saturday, February 21, 2004 7:06:08 am | by AristotlePagaltzis | Revert |
@@ -1,12 +1,10 @@
-[Perl] script to convert [Microsoft] Excel Spreadsheets to
[CSV] (Command Seperated Values)
+This
[Perl] script converts all the worksheets in a MicrosoftExcel SpreadSheet
to individual
[CSV] files.
-Requires the
following [Perl] Modules
:
+The
following modules are required
:
-#
Spreadsheet::~
ParseExcel
-#
Getopt::Long
-
-See also: [
http://search.cpan.org/dist/Spreadsheet
-ParseExcel-Simple
/]
+* [
Spreadsheet::ParseExcel | http://search.cpan.org/dist/Spreadsheet-ParseExcel-Simple/]
+* [
Getopt::Long |
http://search.cpan.org/dist/Getopt
-Long
/] (already included with any standard [Perl] installation)
----
<verbatim>
@@ -74,8 +72,12 @@
Drew Broadley, with contributions from Aristotle Pagaltzis
=head1 COPYRIGHT
+
+FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
+
+Drew Broadley has not clarified the copyright on this code.
FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
=cut
@@ -94,9 +96,8 @@
'S|sep=s' => \(my $opt_separator = ';'),
'v|verbose' => \(my $opt_verbose),
) or pod2usage();
-#1.1 Normal Excel97
my $excel = Spreadsheet::ParseExcel->new();
for (@ARGV) {
my $book = $excel->Parse($_);
@@ -117,11 +118,14 @@
my @row = $worksheet->{MinRow} .. $worksheet->{MaxRow};
my @col = $worksheet->{MinCol} .. $worksheet->{MaxCol};
for my $row ( @{ $worksheet->{Cells} }[ @row ] ) {
- print
$fh join
$opt
_sep,
@$row[ @col ];
- print $fh "\n";
+ my @cellvalue = map {
+
$_ =
$_->Value() if ref $_;
+ $_ = '' if not defined $_;
+ $_;
+ }
@$row[ @col ];
+ print $fh join($opt_separator, @cellvalue),
"\n";
}
-
}
}
</verbatim>