Dear Monks
I have disucssed already in CB and was suggested to put it here. I have the simple code here to read an excel file and write the content into another excel file. Here for the sake of simplicity I am doing without any modification to illustrate the point.
In my input I have few cells have data seperated by a new line ( That's the way it looks). When I open the output file in Excel it looks like that it replaces that data with a single line with subtituting a square shaped character where there was new line in the input. When I 'click' on that with the mouse, it looks exactly same as in input.
If necessary, the data can be manipulted in the program to have it automatically display without clicking.
How I can achieve that..?
The code is
use strict;
use warnings;
use Spreadsheet::ParseExcel::Simple;
use Spreadsheet::WriteExcel::Simple;
#IN
my $file = 'infile.xls';
my $xls = Spreadsheet::ParseExcel::Simple->read($file);
#OUT
my $ss = Spreadsheet::WriteExcel::Simple->new();
my $count;
foreach my $sheet ($xls->sheets) {
while ($sheet->has_data) {
#Reading
my @idata = $sheet->next_row;
@odata = @idata; # Here I can manipulate the data
#Writing
$ss->write_row(\@odata);
last if $count++ > 5;
}
}
print $ss->data;
Thanks.
artist
2003-04-29 edit ybiC: retitle from "Spradsheet Parsing problem"
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.