Sana <> wrote in news:9d2f3fe5-c804-480e-9feb-
:
> I have the following output which I want to convert into excel...Any
> pointers how to achieve it via Spreadsheet::WriteExcel;
>
> I am a beginer so pardon my lack of knowledge in perl.
s/perl/Perl/
perl is the binary, Perl is the language.
Do you know any Perl? Can you put something together using the
documentation for the module Spreadsheet::WriteExcel?
The documentation is extremely clear and well written. Examples abound.
Just the synopsis is enough to solve this problem if you can program in
any language.
So, please read the posting guidelines for this group, then come up with
your best effort at implementing a solution. You will be much more
likely to get good help if you are willing to do that.
To provide some incentive for you to learn how to fish, here is a
template:
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::WriteExcel;
my $book = # add code to create a new workbook
my $sheet = # add code to add a new sheet to $book
while ( my $line = <DATA> ) {
$line =~ s/^\s+//;
$line =~ s/\s+$//;
last unless length $line;
my $row = [ split /\s+/, $line ];
# Add code to write a new row to $sheet
# the special variable $. would be useful
# here. See perldoc perlvar.
}
# add code to close $book
__DATA__
lpar_name minmem desmem maxmem minpr despr maxpr
commuq21 2048 8192 12288 0.1 1.0 2.0
commuq20 2048 8192 12288 0.1 1.0 2.0
commuq23 2048 16384 40960 0.1 2.0 4.0
commud18 3072 40960 61440 0.2 2.0 5.0
commup03 2048 24576 30720 0.1 3.0 4.0
commup02 10240 32768 32768 1.0 4.0 8.0
commup01 10240 32768 32768 1.0 4.0 8.0
--
A. Sinan Unur <>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/