Sonali has asked for the wisdom of the Perl Monks concerning the following question:
Hello PerlMonks,
I have been trying to parse a .xls and another .xlsx file using the Spreadsheet::ParseExcel and Spreadsheet::ParseXLSX modules
When I dump the contents of both the files into two different files, the structure of the hash generated is very different, I wanted to know what exactly is the difference between the two parsers.
My code goes like this,
#!/usr/local/bin/perl use warnings; use strict; use Spreadsheet::XLSX; use Spreadsheet::ParseExcel; use Data::Dumper; my $Output_FileName = 'outfile.txt'; my $Output_FileName1 = 'outfile1.txt'; my $excel = Spreadsheet::XLSX -> new ('book1.xlsx'); my $parser = Spreadsheet::ParseExcel->new(); my $workbook = $parser->parse('book2.xls'); open(my $FH, '>', $Output_FileName) or die "Could not open file '$Outp +ut_FileName' $!"; print $FH Dumper(\$excel); close $FH; open(my $FH1, '>', $Output_FileName1) or die "Could not open file '$Ou +tput_FileName1' $!"; print $FH1 Dumper(\$excel); close $FH1;
Is there a better way to dump both the files so that I can compare the two dumped files? In my case the files were mostly full of information like font etc...
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Differnece between Spreadsheet::ParseXLSX and Spreadsheet::ParseExcel
by 1nickt (Canon) on Mar 27, 2017 at 12:37 UTC | |
|
Re: Differnece between Spreadsheet::ParseXLSX and Spreadsheet::ParseExcel
by madtoperl (Hermit) on Mar 27, 2017 at 09:19 UTC | |
|
Re: Differnece between Spreadsheet::ParseXLSX and Spreadsheet::ParseExcel
by Anonymous Monk on Mar 27, 2017 at 06:24 UTC |