Penguin

Differences between current version and predecessor to the previous major change of Excel2CSV.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 8 Last edited on Tuesday, November 23, 2004 4:50:58 pm by JohnMcPherson
Older page: version 3 Last edited on Saturday, February 21, 2004 7:06:08 am by AristotlePagaltzis Revert
@@ -1,12 +1,11 @@
-[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 
+* [ 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)  
  
-See also: [http://search.cpan.org/dist/Spreadsheet-ParseExcel-Simple/]  
  
 ---- 
  
 <verbatim> 
@@ -74,8 +73,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 +97,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 +119,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>