in reply to Spreadsheet::ParseExcel Numeric Format Woes
Here is a short example which assumes that there is formatted data in cell A1 of the first worksheet:
#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::FmtDefault; my $file = Spreadsheet::ParseExcel->new(); my $format = Spreadsheet::ParseExcel::FmtDefault->new(); my $workbook = $file->Parse('test.xls'); my ($row, $col) = (0, 0); my $worksheet = $workbook->{Worksheet}[0]; my $cell = $worksheet->{Cells}[$row][$col]; print $format->FmtString($cell, $workbook), "\n";
You could also consider the Spreadsheet::ParseExcel::SaveParser part of Spreadsheet::ParseExcel which can be used to update an existing Excel file. The following is an example from the pod of the newer simplified interface.
use strict; use Spreadsheet::ParseExcel::SaveParser; $oBook = Spreadsheet::ParseExcel::SaveParser::Workbook->Parse('Test97.x +ls'); my $oWs = $oBook->AddWorksheet('TEST1'); $oWs->AddCell(10, 1, 'New Cell'); $oBook->SaveAs('iftest.xls');
--
John.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Spreadsheet::ParseExcel Numeric Format Woes
by Mr. Muskrat (Canon) on Aug 14, 2002 at 23:28 UTC | |
by Anonymous Monk on Jun 03, 2010 at 05:25 UTC | |
by jdporter (Paladin) on Jun 03, 2010 at 18:16 UTC |