Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Output to an Excel Document

by OM_Zen (Scribe)
on Mar 12, 2003 at 15:01 UTC ( #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++; } }



Comment on Re: Output to an Excel Document
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2014-04-21 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (489 votes), past polls