Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting?

by Anonymous Monk
on Feb 20, 2006 at 01:14 UTC ( #531316=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hey,

Has anyone used this to read an excel file? I have a code that uses SpreadSheet::ParseExcel to extract data and print it out as a HTML table, but I have no clue on how I can use this module to retrieve the formatting of the cell. For example, If a cell in excel being read is in italic, then I would like it to be italic when I print it out as HTML.

I know that the SpreadSheet::ParseExcel::Font can retrieve the font type of the cell being read, but I have no clue how to implement it.

I read the documentation for it and everything, but have no clue where to start.

ty

2006-02-21 Retitled by g0n, as per Monastery guidelines
Original title: 'SpreadSheet::ParseExcel::Font'

Comment on Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting?
Re: Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting?
by monarch (Priest) on Feb 20, 2006 at 01:28 UTC
    You can pretty much just use the example code in Spreadsheet::ParseExcel as I have done below:

    The clue is to get hold of the 'Font' object from the 'Format' object of the cell in question.

    The output I get when feeding in an example spreadsheet I created myself was:

    [root@monarch monarch]# perl /tmp/parseexcel.pl /tmp/deleteme.xls --------- SHEET:Sheet1 ( 1 , 1 ) =>This cell is normal ( 2 , 1 ) =>This cell is italic (italic) ( 3 , 1 ) =>This cell is normal --------- SHEET:Sheet2 --------- SHEET:Sheet3

    Update: corrected spelling of CPAN module

Re: Can SpreadSheet::ParseExcel::Font retrieve a cell's formatting?
by Anonymous Monk on Feb 20, 2006 at 02:08 UTC
    god bless you my dare friend.

    I've been trying to figure out how to do this for the last day...non-stop searching document and threads on this board. You see, I knew the module I was using was capable of this, but since it had it no example on the man doc, I wasn't able to figure out how to use it.

    If I was to learn how to use modules more, would I be able to figure out something like this next time?

    ty

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://531316]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2014-10-02 00:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (41 votes), past polls