.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Spreadsheet::ParseExcel::Cell 3" .TH Spreadsheet::ParseExcel::Cell 3 "2010-01-24" "perl v5.8.4" "User Contributed Perl Documentation" .SH "NAME" Spreadsheet::ParseExcel::Cell \- A class for Cell data and formatting. .SH "SYNOPSIS" .IX Header "SYNOPSIS" See the documentation for Spreadsheet::ParseExcel. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used in conjunction with Spreadsheet::ParseExcel. See the documentation for Spreadsheet::ParseExcel. .SH "Methods" .IX Header "Methods" The following Cell methods are available: .PP .Vb 7 \& $cell->value() \& $cell->unformatted() \& $cell->get_format() \& $cell->type() \& $cell->encoding() \& $cell->is_merged() \& $cell->get_rich_text() .Ve .Sh "\fIvalue()\fP" .IX Subsection "value()" The \f(CW\*(C`value()\*(C'\fR method returns the formatted value of the cell. .PP .Vb 1 \& my $value = $cell->value(); .Ve .PP Formatted in this sense refers to the numeric format of the cell value. For example a number such as 40177 might be formatted as 40,117, 40117.000 or even as the date 2009/12/30. .PP If the cell doesn't contain a numeric format then the formatted and unformatted cell values are the same, see the \f(CW\*(C`unformatted()\*(C'\fR method below. .PP For a defined \f(CW$cell\fR the \f(CW\*(C`value()\*(C'\fR method will always return a value. .PP In the case of a cell with formatting but no numeric or string contents the method will return the empty string \f(CW''\fR. .Sh "\fIunformatted()\fP" .IX Subsection "unformatted()" The \f(CW\*(C`unformatted()\*(C'\fR method returns the unformatted value of the cell. .PP .Vb 1 \& my $unformatted = $cell->unformatted(); .Ve .PP Returns the cell value without a numeric format. See the \f(CW\*(C`value()\*(C'\fR method above. .Sh "\fIget_format()\fP" .IX Subsection "get_format()" The \f(CW\*(C`get_format()\*(C'\fR method returns the Spreadsheet::ParseExcel::Format object for the cell. .PP .Vb 1 \& my $format = $cell->get_format(); .Ve .PP If a user defined format hasn't been applied to the cell then the default cell format is returned. .Sh "\fItype()\fP" .IX Subsection "type()" The \f(CW\*(C`type()\*(C'\fR method returns the type of cell such as Text, Numeric or Date. If the type was detected as Numeric, and the Cell Format matches \f(CW\*(C`m{^[dmy][\-\e\e/dmy]*$}i\*(C'\fR, it will be treated as a Date type. .PP .Vb 1 \& my $type = $cell->type(); .Ve .PP See also \*(L"Dates and Time in Excel\*(R". .Sh "\fIencoding()\fP" .IX Subsection "encoding()" The \f(CW\*(C`encoding()\*(C'\fR method returns the character encoding of the cell. .PP .Vb 1 \& my $encoding = $cell->encoding(); .Ve .PP This method is only of interest to developers. In general Spreadsheet::ParseExcel will return all character strings in \s-1UTF\-8\s0 regardless of the encoding used by Excel. .PP The \f(CW\*(C`encoding()\*(C'\fR method returns one of the following values: .IP "* 0: Unknown format. This shouldn't happen. In the default case the format should be 1." 4 .IX Item "0: Unknown format. This shouldn't happen. In the default case the format should be 1." .PD 0 .IP "* 1: 8bit \s-1ASCII\s0 or single byte \s-1UTF\-16\s0. This indicates that the characters are encoded in a single byte. In Excel 95 and earlier This usually meant \s-1ASCII\s0 or an international variant. In Excel 97 it refers to a compressed \s-1UTF\-16\s0 character string where all of the high order bytes are 0 and are omitted to save space." 4 .IX Item "1: 8bit ASCII or single byte UTF-16. This indicates that the characters are encoded in a single byte. In Excel 95 and earlier This usually meant ASCII or an international variant. In Excel 97 it refers to a compressed UTF-16 character string where all of the high order bytes are 0 and are omitted to save space." .IP "* 2: \s-1UTF\-16BE\s0." 4 .IX Item "2: UTF-16BE." .IP "* 3: Native encoding. In Excel 95 and earlier this encoding was used to represent multi-byte character encodings such as \s-1SJIS\s0." 4 .IX Item "3: Native encoding. In Excel 95 and earlier this encoding was used to represent multi-byte character encodings such as SJIS." .PD .Sh "\fIis_merged()\fP" .IX Subsection "is_merged()" The \f(CW\*(C`is_merged()\*(C'\fR method returns true if the cell is merged. .PP .Vb 1 \& my $is_merged = $cell->is_merged(); .Ve .PP Returns \f(CW\*(C`undef\*(C'\fR if the property isn't set. .Sh "\fIget_rich_text()\fP" .IX Subsection "get_rich_text()" The \f(CW\*(C`get_rich_text()\*(C'\fR method returns an array ref of font information about each string block in a \*(L"rich\*(R", i.e. multi\-format, string. .PP .Vb 1 \& my $rich_text = $cell->get_rich_text(); .Ve .PP The return value is an arrayref of arrayrefs in the form: .PP .Vb 4 \& [ \& [ $start_position, $font_object ], \& ..., \& ] .Ve .PP Returns undef if the property isn't set. .SH "Dates and Time in Excel" .IX Header "Dates and Time in Excel" Dates and times in Excel are represented by real numbers, for example \*(L"Jan 1 2001 12:30 \s-1PM\s0\*(R" is represented by the number 36892.521. .PP The integer part of the number stores the number of days since the epoch and the fractional part stores the percentage of the day. .PP A date or time in Excel is just like any other number. The way in which it is displayed is controlled by the number format: .PP .Vb 8 \& Number format $cell->value() $cell->unformatted() \& ============= ============== ============== \& 'dd/mm/yy' '28/02/08' 39506.5 \& 'mm/dd/yy' '02/28/08' 39506.5 \& 'd-m-yyyy' '28-2-2008' 39506.5 \& 'dd/mm/yy hh:mm' '28/02/08 12:00' 39506.5 \& 'd mmm yyyy' '28 Feb 2008' 39506.5 \& 'mmm d yyyy hh:mm AM/PM' 'Feb 28 2008 12:00 PM' 39506.5 .Ve .PP The Spreadsheet::ParseExcel::Utility module contains a function called \f(CW\*(C`ExcelLocaltime\*(C'\fR which will convert between an unformatted Excel date/time number and a \f(CW\*(C`localtime()\*(C'\fR like array. .PP For date conversions using the \s-1CPAN\s0 \f(CW\*(C`DateTime\*(C'\fR framework see DateTime::Format::Excel http://search.cpan.org/search?dist=DateTime\-Format\-Excel .SH "AUTHOR" .IX Header "AUTHOR" Maintainer 0.40+: John McNamara jmcnamara@cpan.org .PP Maintainer 0.27\-0.33: Gabor Szabo szabgab@cpan.org .PP Original author: Kawai Takanori kwitknr@cpan.org .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2009\-2010 John McNamara .PP Copyright (c) 2006\-2008 Gabor Szabo .PP Copyright (c) 2000\-2006 Kawai Takanori .PP All rights reserved. .PP You may distribute under the terms of either the \s-1GNU\s0 General Public License or the Artistic License, as specified in the Perl \s-1README\s0 file.