.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" 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" '' '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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" 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::XLSX::Utility2007 3pm" .TH Spreadsheet::XLSX::Utility2007 3pm "2010-05-16" "perl v5.10.1" "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::XLSX::Utility2007 \- Utility function for Spreadsheet::XLSX .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use strict; \& #Declare \& use Spreadsheet::XLSX::Utility qw(ExcelFmt ExcelLocaltime LocaltimeExcel); \& \& #Convert localtime \->Excel Time \& my $iBirth = LocaltimeExcel(11, 10, 12, 23, 2, 64); \& # = 1964\-3\-23 12:10:11 \& print $iBirth, "\en"; # 23459.5070717593 \& \& #Convert Excel Time \-> localtime \& my @aBirth = ExcelLocaltime($iBirth, undef); \& print join(":", @aBirth), "\en"; # 11:10:12:23:2:64:1:0 \& \& #Formatting \& print ExcelFmt(\*(Aqyyyy\-mm\-dd\*(Aq, $iBirth), "\en"; #1964\-3\-23 \& print ExcelFmt(\*(Aqm\-d\-yy\*(Aq, $iBirth), "\en"; # 3\-23\-64 \& print ExcelFmt(\*(Aq#,##0\*(Aq, $iBirth), "\en"; # 23,460 \& print ExcelFmt(\*(Aq#,##0.00\*(Aq, $iBirth), "\en"; # 23,459.51 \& print ExcelFmt(\*(Aq"My Birthday is (m/d):" m/d\*(Aq, $iBirth), "\en"; \& # My Birthday is (m/d): 3/23 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Spreadsheet::XLSX::Utility exports utility functions concerned with Excel format setting. .PP ExcelFmt is used by Spreadsheet::XLSX::Fmt2007.pm which is used by Spreadsheet::XLSX. .SH "Functions" .IX Header "Functions" This module can export 3 functions: ExcelFmt, ExcelLocaltime and LocaltimeExcel. .SS "ExcelFmt" .IX Subsection "ExcelFmt" \&\f(CW$sTxt\fR = ExcelFmt($sFmt, \f(CW$iData\fR [, \f(CW$i1904\fR]); .PP \&\fI\f(CI$sFmt\fI\fR is a format string for Excel. \fI\f(CI$iData\fI\fR is the target value. If \fI\f(CI$flg1904\fI\fR is true, this functions assumes that epoch is 1904. \&\fI\f(CI$sTxt\fI\fR is the result. .PP For more detail and examples, please refer sample/chkFmt.pl in this distribution. .PP ex. .SS "ExcelLocaltime" .IX Subsection "ExcelLocaltime" ($iSec, \f(CW$iMin\fR, \f(CW$iHour\fR, \f(CW$iDay\fR, \f(CW$iMon\fR, \f(CW$iYear\fR, \f(CW$iwDay\fR, \f(CW$iMSec\fR) = ExcelLocaltime($iExTime [, \f(CW$flg1904\fR]); .PP \&\fIExcelLocaltime\fR converts time information in Excel format into Perl localtime format. \&\fI\f(CI$iExTime\fI\fR is a time of Excel. If \fI\f(CI$flg1904\fI\fR is true, this functions assumes that epoch is 1904. \&\fI\f(CI$iSec\fI\fR, \fI\f(CI$iMin\fI\fR, \fI\f(CI$iHour\fI\fR, \fI\f(CI$iDay\fI\fR, \fI\f(CI$iMon\fI\fR, \fI\f(CI$iYear\fI\fR, \fI\f(CI$iwDay\fI\fR are same as localtime. \&\fI\f(CI$iMSec\fI\fR means 1/1,000,000 seconds(ms). .SS "LocaltimeExcel" .IX Subsection "LocaltimeExcel" \&\fI\f(CI$iExTime\fI\fR = LocaltimeExcel($iSec, \f(CW$iMin\fR, \f(CW$iHour\fR, \f(CW$iDay\fR, \f(CW$iMon\fR, \f(CW$iYear\fR [,$iMSec] [,$flg1904]) .PP \&\fILocaltimeExcel\fR converts time information in Perl localtime format into Excel format . \&\fI\f(CI$iSec\fI\fR, \fI\f(CI$iMin\fI\fR, \fI\f(CI$iHour\fI\fR, \fI\f(CI$iDay\fI\fR, \fI\f(CI$iMon\fI\fR, \fI\f(CI$iYear\fI\fR are same as localtime. .PP If \fI\f(CI$flg1904\fI\fR is true, this functions assumes that epoch is 1904. \&\fI\f(CI$iExTime\fI\fR is a time of Excel. .SS "col2int" .IX Subsection "col2int" \&\fI\f(CI$iInt\fI\fR = col2int($sCol); .PP converts a excel row letter into an int for use in an array .PP This function was contributed by Kevin Mulholland. .SS "int2col" .IX Subsection "int2col" \&\fI\f(CI$sCol\fI\fR = int2col($iRow); .PP convert a column number into column letters \&\s-1NOET:\s0 This is quite a brute force coarse method does not manage values over 701 (\s-1ZZ\s0) .PP This function was contributed by Kevin Mulholland. .SS "sheetRef" .IX Subsection "sheetRef" (\fI\f(CI$iRow\fI\fR, \fI\f(CI$iCol\fI\fR) = sheetRef($sStr); .PP convert an excel letter-number address into a useful array address \&\s-1NOTE:\s0 That also Excel uses X\-Y notation, we normally use Y\-X in arrays \&\f(CW$sStr\fR, excel coord (eg. A2). .PP This function was contributed by Kevin Mulholland. .SS "xls2csv" .IX Subsection "xls2csv" \&\f(CW$sCsvTxt\fR = xls2csv($sFileName, \f(CW$sRegion\fR, \f(CW$iRotate\fR); .PP convert a chunk of an excel file into csv text chunk \&\f(CW$sRegions\fR = \*(L"sheet\-colrow:colrow\*(R" (ex. '1\-A1:B2' means 'A1:B2' for sheet 1) \&\f(CW$iRotate\fR = 0 or 1 (output should be rotated or not) .PP This function was contributed by Kevin Mulholland. .SH "AUTHOR" .IX Header "AUTHOR" Rob Polocz rob.polocz@trackvia.com based on work by for Spreadsheet::ParseExcel by Kawai Takanori (Hippo2000) used with permission .SH "SEE ALSO" .IX Header "SEE ALSO" Spreadsheet::ParseExcel, Spreadsheet::WriteExcel .SH "COPYRIGHT" .IX Header "COPYRIGHT" This module is part of the Spreadsheet::XLSX distribution.