Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The infinity loop for the below comparison code is my issue. The ADdata sheet first column contain 1-30000 users data and prod_log sheet contain around 501 entries of users those are Nonunique . I will need to collect unique entries from prod_log first column and compare against ADdata sheet first column and update the existing entries of the same file and update the match to other file. The above code seems to be not working. need some suggestion or code snippet.

for my $worksheet1 ( $workbook1->worksheets() ) { my ( $row_min , $row_max) = $worksheet1->row_range(); my ($col_min, $col_max) = $worksheet1->col_range(); $worksheet->write(0, 0, 'AD Match' , $my_format); $worksheet->write(0, 1, 'APP STATUS' , + $my_format); $worksheet->write(0, 2, 'APP LABEL' , +$my_format); my $appssheet = $worksheet1->get_name(); print "APP Sheet name: $appssheet . \n"; for my $row ( $row_min .. $row_max ) { for my $col ( $col_min = 0) { if ( $appssheet eq $appsshhetname ) { my $cell = $worksheet1->get_cell( $row, 0 ); next unless $cell; my $cellA = $cell->value; push @cellA, $cellA ; # push @cellA, $cellA if $cellA=~ /(\d{9})/; } my %params = map { $_ => 1 } @cellA; my @uniq = keys %params; if ( $appssheet eq $ADdata ) { for my $row1 ( $row_min .. $row_max ) { for my $col1 ( $col_min = 0) { my $cellB = $worksheet1->get_cell( $row, 0 ); next unless $cellB; my $cellC = $cellB->value; $cellC =~ s/@(AD.ABC.COM)//g; print "USERS: $cellC\n"; $worksheet->write($r, 0, $cellC) if exists $pa +rams{$cellC}; } } $r += 1; } } } }

In reply to Re^4: Unable to compare 2 arrays from 2 separate columns of separate sheets. by chandantul
in thread Unable to compare 2 arrays from 2 separate columns of separate sheets. by chandantul

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found