File: //usr/local/share/man/man3/Spreadsheet::XLSX::Utility2007.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" 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 >0, 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
.\" ========================================================================
.\"
.IX Title "Spreadsheet::XLSX::Utility2007 3"
.TH Spreadsheet::XLSX::Utility2007 3 "2024-03-09" "perl v5.26.3" "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::Utility2007 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::Utility2007 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.