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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.