Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^5: string TRUE/FALSE getting converted to 1/0

by soonix (Canon)
on Jun 16, 2015 at 10:43 UTC ( [id://1130583]=note: print w/replies, xml ) Need Help??


in reply to Re^4: string TRUE/FALSE getting converted to 1/0
in thread string TRUE/FALSE getting converted to 1/0

I see two possibilities:
  • Excel might store the information differently. If can open the XLSX file with your Excel and then "save as" XLS, how do these "TRUE/FALSE" fields look like, when freshly opening the (new) XLS file in Excel?
  • According to the doc, Spreadsheet::XLSX wants to be compatible with Spreadsheet::ParseExcel, but perhaps it isn't. Another module is Spreadsheet::ParseXLSX, which also tries to be a drop-in replacement.
  • Comment on Re^5: string TRUE/FALSE getting converted to 1/0

Replies are listed 'Best First'.
Re^6: string TRUE/FALSE getting converted to 1/0
by nayakr (Novice) on Jun 16, 2015 at 14:33 UTC
    Thanks for your response Soonix. I have tried converting the XLSX to XLS and then to csv using this script and that is converting as intended. As for Spreadsheet::ParseExcel, it is compatible only for excel 95-2003 binary formats. Spreadsheet::XLSX is compatible for excel 2007 Raj
      you misunderstood my second bullet point. The modules try to be "exchangeable", so it should be possible to write something like
      my $excel_obj; if ($ext eq ".xls") { $excel_obj = Spreadsheet::ParseExcel->new(); } elsif ($ext eq ".xlsx") { $excel_obj = Spreadsheet::ParseXLSX->new(); } elsif ($ext eq ".ods") { $excel_obj = Spreadsheet::ReadSXC->new(); } else { die "Extension $ext not (yet) supported..."; } my $workbook = $excel_obj->Parse( ... );
      and have just one loop through the spreadsheet, instead of one for each file type.
      That said, looks like someone (Tux) already took a similiar approach and wrote Spreadsheet::Read

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1130583]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-26 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found