.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" 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::Utility 3" .TH Spreadsheet::ParseExcel::Utility 3 "2008-01-01" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" Spreadsheet::ParseExcel::Utility \- Utility function for Spreadsheet::ParseExcel .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use strict; \& #Declare \& use Spreadsheet::ParseExcel::Utility qw(ExcelFmt ExcelLocaltime LocaltimeExcel); .Ve .PP .Vb 4 \& #Convert localtime ->Excel Time \& my $iBirth = LocaltimeExcel(11, 10, 12, 23, 2, 64); \& # = 1964-3-23 12:10:11 \& print $iBirth, "\en"; # 23459.5070717593 .Ve .PP .Vb 3 \& #Convert Excel Time -> localtime \& my @aBirth = ExcelLocaltime($iBirth, undef); \& print join(":", @aBirth), "\en"; # 11:10:12:23:2:64:1:0 .Ve .PP .Vb 7 \& #Formatting \& print ExcelFmt('yyyy-mm-dd', $iBirth), "\en"; #1964-3-23 \& print ExcelFmt('m-d-yy', $iBirth), "\en"; # 3-23-64 \& print ExcelFmt('#,##0', $iBirth), "\en"; # 23,460 \& print ExcelFmt('#,##0.00', $iBirth), "\en"; # 23,459.51 \& print ExcelFmt('"My Birthday is (m/d):" m/d', $iBirth), "\en"; \& # My Birthday is (m/d): 3/23 .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Spreadsheet::ParseExcel::Utility exports utility functions concerned with Excel format setting. .SH "Functions" .IX Header "Functions" This module can export 3 functions: ExcelFmt, ExcelLocaltime and LocaltimeExcel. .Sh "ExcelFmt" .IX Subsection "ExcelFmt" $sTxt = ExcelFmt($sFmt, \f(CW$iData\fR [, \f(CW$i1904\fR]); .PP \&\fI$sFmt\fR is a format string for Excel. \fI$iData\fR is the target value. If \fI$flg1904\fR is true, this functions assumes that epoch is 1904. \&\fI$sTxt\fR is the result. .PP For more detail and examples, please refer sample/chkFmt.pl in this distribution. .PP ex. .Sh "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$iExTime\fR is a time of Excel. If \fI$flg1904\fR is true, this functions assumes that epoch is 1904. \&\fI$iSec\fR, \fI$iMin\fR, \fI$iHour\fR, \fI$iDay\fR, \fI$iMon\fR, \fI$iYear\fR, \fI$iwDay\fR are same as localtime. \&\fI$iMSec\fR means 1/1,000,000 seconds(ms). .Sh "LocaltimeExcel" .IX Subsection "LocaltimeExcel" \&\fI$iExTime\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$iSec\fR, \fI$iMin\fR, \fI$iHour\fR, \fI$iDay\fR, \fI$iMon\fR, \fI$iYear\fR are same as localtime. .PP If \fI$flg1904\fR is true, this functions assumes that epoch is 1904. \&\fI$iExTime\fR is a time of Excel. .Sh "col2int" .IX Subsection "col2int" \&\fI$iInt\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. .Sh "int2col" .IX Subsection "int2col" \&\fI$sCol\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. .Sh "sheetRef" .IX Subsection "sheetRef" (\fI$iRow\fR, \fI$iCol\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. .Sh "xls2csv" .IX Subsection "xls2csv" $sCsvTxt = 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" Kawai Takanori (Hippo2000) kwitknr@cpan.org .PP .Vb 2 \& http://member.nifty.ne.jp/hippo2000/ (Japanese) \& http://member.nifty.ne.jp/hippo2000/index_e.htm (English) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Spreadsheet::ParseExcel, Spreadsheet::WriteExcel .SH "COPYRIGHT" .IX Header "COPYRIGHT" This module is part of the Spreadsheet::ParseExcel distribution.