Hi people. I have 2 excel files with data in it. I should make a consolidated excel file from the 2 files. Im able to parse the file but donot how to write back in another excel file. can u please help. The code I used for parsing is shown bellow
#!/usr/bin/perl -w # For Spresdsheet Read/Write Operations use Spreadsheet::ParseExcel; my $excel_filename = $ARGV[0] or die "Must specify filename to parse.\ +n"; #$excel_filename = "sample.xls"; sub Workbook_open{ # Excel file access in universal $u = new Spreadsheet::ParseExcel; $ubook = $u->Parse($excel_filename); $ubook_max_sheets = $ubook->{SheetCount}; print "\nSheet Count = $ubook_max_sheets\n"; foreach $index (0 .. $ubook_max_sheets - 1){ $eSheet = $ubook->{Worksheet}[$index]; $sheetName = $eSheet->{Name}; print"\n\nSheet name : $sheetName\n\n"; if(defined($eSheet->{MaxRow}) and defined($eSheet->{MaxCol})){ $Row_max = $eSheet->{MaxRow}; $Col_max = $eSheet->{MaxCol}; $Row_min = $eSheet->{MinRow}; $Col_min = $eSheet->{MinCol}; foreach $row_num ($Row_min .. $Row_max){ foreach $col_num ($Col_min .. $Col_max){ if(defined($eSheet->{Cells}[$row_num][$col_num]->V +alue)){ $temp = $eSheet->{Cells}[$row_num][$col_num]-> +Value; print "$temp\t"; } } print "\n"; } } } } &Workbook_open();
In reply to writing after parsing by Ashwitha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |