.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .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. \*(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- .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" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" 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 3pm" .TH Spreadsheet::ParseExcel::Cell 3pm "2014-03-18" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .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 8 \& $cell\->value() \& $cell\->unformatted() \& $cell\->get_format() \& $cell\->type() \& $cell\->encoding() \& $cell\->is_merged() \& $cell\->get_rich_text() \& $cell\->get_hyperlink() .Ve .SS "\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\*(Aq\*(Aq\fR. .SS "\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. .SS "\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. .SS "\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". .SS "\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 "\(bu" 4 0: Unknown format. This shouldn't happen. In the default case the format should be 1. .IP "\(bu" 4 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. .IP "\(bu" 4 2: \s-1UTF\-16BE.\s0 .IP "\(bu" 4 3: Native encoding. In Excel 95 and earlier this encoding was used to represent multi-byte character encodings such as \s-1SJIS.\s0 .SS "\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. .SS "\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. .SS "\fIget_hyperlink()\fP" .IX Subsection "get_hyperlink()" If a cell contains a hyperlink, the \f(CW\*(C`get_hyperlink()\*(C'\fR method returns an array ref of information about it. .PP A cell can contain at most one hyperlink. If it does, it contains no other value. .PP Otherwise, it returns undef; .PP The array contains: .IP "\(bu" 4 0: Description (what's displayed); undef if not present .IP "\(bu" 4 1: Link, converted to an appropriate \s-1URL \-\s0 Note: Relative links are based on the input file. \f(CW%REL\fR% is used if the input file is unknown (e.g. a file handle or scalar) .IP "\(bu" 4 2: Target \- target frame (or undef if none) .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\*(R"\s0 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() \& ============= ============== ============== \& \*(Aqdd/mm/yy\*(Aq \*(Aq28/02/08\*(Aq 39506.5 \& \*(Aqmm/dd/yy\*(Aq \*(Aq02/28/08\*(Aq 39506.5 \& \*(Aqd\-m\-yyyy\*(Aq \*(Aq28\-2\-2008\*(Aq 39506.5 \& \*(Aqdd/mm/yy hh:mm\*(Aq \*(Aq28/02/08 12:00\*(Aq 39506.5 \& \*(Aqd mmm yyyy\*(Aq \*(Aq28 Feb 2008\*(Aq 39506.5 \& \*(Aqmmm d yyyy hh:mm AM/PM\*(Aq \*(AqFeb 28 2008 12:00 PM\*(Aq 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" Current maintainer 0.60+: Douglas Wilson dougw@cpan.org .PP Maintainer 0.40\-0.59: 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) 2014 Douglas Wilson .PP Copyright (c) 2009\-2013 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.