Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Output to an Excel Document

by OM_Zen (Scribe)
on Mar 12, 2003 at 15:01 UTC ( [id://242374]=note: print w/replies, xml ) Need Help??


in reply to Output to an Excel Document

Hi ,

The xls spreadsheets can be generated using the distribution Spreadsheet::WriteExcel like as in here

use Spreadsheet::WriteExcel; # open the text one in here my $Files = shift; my $FilesExcel =$Files . "\.xls"; $FilesExcel =~ s/\.txt//g; my $WorkbookForFiles = Spreadsheet::WriteExcel->new($FilesExcel); my $WorksheetForFiles = $WorkbookForFiles->addworksheet('FTP_Outg +oing_Alert_Tracking_ Report'); # Change the permission to 770 however you have to my $format_for_WorkbookFiles= $WorkbookForFiles->addformat(); $format_for_WorkbookFiles->set_bold(1); $format_for_WorkbookFiles->set_color('black'); $format_for_WorkbookFiles->set_align('center'); $WorksheetForFiles->set_column(0,20,20); open(fh , "<$Files"); my $rownum = 0; my @fields; my $columnum; while (<fh>){ $columnnum = 0; chomp; @fields = split('\|',$_); $WorksheetForFiles->activate(); foreach my $Fields(@fields){ $WorksheetForFiles->write($rownum ,$columnnum,$Fields,$for +mat_for_WorkbookFile s); $columnnum++; } $rownum++; } }


Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://242374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-29 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found