I am stumped on this problem. I have imported an excel file through means of Spreadsheet::ParseExcel. My exported plain-text file will be pipe delimited. My current excel sheet has a column with URL's with a link format to each row. When I run my script the URL field comes back as 0. I noticed that the values of the URL fields are numeric.
I want to capture the actual url name not the numeric value.
Here is a bit of my code:
my $excel_obj = Spreadsheet::ParseExcel->new();
my $workbook = $excel_obj->Parse($arg{xls});
die "Workbook did not return worksheets!\n"
unless ref $workbook->{Worksheet} eq 'ARRAY';
for my $worksheet ( @{$workbook->{Worksheet}} ) {
my $last_col = $worksheet->{MaxCol} || 0;
my $last_row = $worksheet->{MaxRow} || 0;
for my $row ( 0 .. $last_row ) {
for my $col ( 0,1,$last_col ) {
my $cell = $worksheet->{Cells}[$row][$col];
print ref $cell ?
$cell->Value : '';
print $arg{field_sep} unless $col == $last_col;
}
print $arg{record_sep}; # record ends
}
print "\n"; # worksheet ends
}
Thanks!
Derek Perriero
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.