# xlscat -c book.xls > book.csvDone!
Spreadsheet::Read comes with a nice little utility xlscat for reading a few kinds of spreadsheets and writing out some text files.
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
As the above monks said you hav to install
Spreadsheet::WriteExcel and also Text::CSV_XS . I hope this could be helpful for you. And also before posting a query do some work and just show us that u have tried out something so that we can help u in a better way.
#!/usr/bin/perl
# Transfer The CSV File data To Xcel Sheet
use strict;
use Text::CSV_XS;
use Spreadsheet::WriteExcel;
#### Create A Xcel SpreadSheet ####
my $workbook = Spreadsheet::WriteExcel->new("csv-xcel.xls") or die ("Cannot Create Xcel : $!\n ");
my $worksheet = $workbook->add_worksheet();
#### Create The CSV Text ####
my $csv = Text::CSV_XS->new;
my ( $row, $col, $fc, $comma, @fcsv, @fields );
###
open( CSV, "data.txt") or die ("Couldn't Open The Text File : $!\n ");
@fcsv = ;
close(CSV);
foreach $fc (@fcsv)
{
if ( $csv->parse($fc) )
{
$col= 0;
@fields = $csv->fields;
foreach $comma ( @fields )
{
$worksheet->write($row,$col,$comma);
$col++;
}
}
$row++;
}
print "Xcel sheet xls is Created ! \n";
Cheers,
JohnGG
perlmonks.org content © perlmonks.org and Anonymous Monk, cbu, diotalevi, johngg, msk_0984, zentara
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03