Hello Ashwitha,
As the Anonymous monk suggest it is better to go online read and find what exactly you are looking for. There are so many options to choose that can not be included in one answer.
Although that I have never worked with spreadsheets in Perl I found Spreadsheet::ParseExcel::SaveParser from CPAN written by Douglas Wilson.
I just created a sample.xls file exactly as the example in the tutorial shows which is able to duplicate your file and produce a new one with a new name.
Sample of the code provided in the tutorial:
#!/usr/bin/perl use strict; use warnings; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; # Open an existing file with SaveParser my $parser = Spreadsheet::ParseExcel::SaveParser->new(); my $template = $parser->Parse('template.xls'); # Get the first worksheet. my $worksheet = $template->worksheet(0); my $row = 0; my $col = 0; # Overwrite the string in cell A1 $worksheet->AddCell( $row, $col, 'New string' ); # Add a new string in cell B1 $worksheet->AddCell( $row, $col + 1, 'Newer' ); # Add a new string in cell C1 with the format from cell A3. my $cell = $worksheet->get_cell( $row + 2, $col ); my $format_number = $cell->{FormatNo}; $worksheet->AddCell( $row, $col + 2, 'Newest', $format_number ); # Write over the existing file or write a new file. $template->SaveAs('newfile.xls');
There are analytic instructions in the tutorial on how the code operates.
To make it work I had to also install Spreadsheet::WriteExcel module.
I hope this is close to what you where looking for.
In reply to Re: writing after parsing
by thanos1983
in thread writing after parsing
by Ashwitha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |