Hello Guys, I have wrote one WIN32:OLE perl script to compare two .xls file and update one .xls In short: file.xls column 1conatins:
\SUM\SUM_cam.c \SUM\SUM_cam.h \SUM\SUM_command.c \SUM\SUM_command.h \SUM\SUM_dab.c \SUM\SUM_dmb.c \SUM\SUM_eventHandler.h \SUM\SUM_eventHandler_dab.c \SUM\SUM_eventHandler_dmb.c \SUM\SUM_fap.c \SUM\SUM_fap.h \SUM\SUM_private.h \SUM\SUM_task_dab.c \SUM\SUM_task_dmb.c \SUM\Makefile \SUM\SUM_cam.c
V3.xls column 1contains :
\SUM\SUM_cam.c@@\main\base2ucm_source\600_int\1 \NEW\NEW_calc.c@@\main\base2ucm_source\600_int\1 \NEW\NEW_FAP.c@@\main\base2ucm_source\600_dev_dmb\1 \SIN\COM\SIN_COMconnection.c@@\main\base2ucm_source\600_int\1 \SIN\COM\COMconnection.sm@@\main\base2ucm_source\600_int\1 \SIN\IN\SIN_INdevice.c@@\main\base2ucm_source\600_int\1 \SUM\SUM_cam.c@@\main\base2ucm_source\600_int\1

Now i am comparing each element of file.xls with V3.xls If the element of each row of file.xls is present in V3.xls then i am updating the corresponding row of second column in file.xls with (*) mark

#!/usr/bin/perl -w use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; #$Win32::OLE::Warn = 3; # die on errors +... # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # open Excel file my $Book = $Excel->Workbooks->Open("u:/file.xls"); my $Book1 = $Excel->Workbooks->Open("u:/v3.xls"); # select worksheet number 1 (you can also select a worksheet by name) my $Sheet = $Book->Worksheets(1); my $Sheet1 = $Book1->Worksheets(1); my $val1; my $cnt=0; my $line; foreach my $row (1..3000) { foreach my $col (1) { my $val; next unless defined $Sheet->Cells($row,1)->{'Value'}; $val = $Sheet->Cells($row,1)->{'Value'}; #findl($val); for($cnt=1;$cnt<=65536;$cnt++){ $val1 = $Sheet1->Cells($cnt,1)->{'Value'}; if ((defined $val1) && (index($val1,$val) != -1)){ $line =$cnt if (!defined $line); $Sheet->Cells($row,2)->{'Value'}= *; last; } } } } $Book->SaveAs ("u:/file.xls") ; # clean up after ourselves $Book->Close; $Book1->Close;
But after executing the .exe generated from the script there is no ouput. Anyone please guide me where is the problem

In reply to WIN32OLE program to compare by suvendu4urs

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.