#!usr/bin/perl -w use strict; my $file1 = 'aagdbp01.mydomain.it;PatrolAgent_3181;Patrol Agent;AIX;PRODUZIONE;AGE +NZIE-;AIX 5-3;PowerPC_POWER6;UNKNOWN;UNKNOWN;UNKNOWN;PRODUZIONE-ND aagdbp01.mydomain.it;QP1GAGA1;QM WMQ;AIX;PRODUZIONE;AGENZIE;AIX 5-3;Po +werPC_POWER6;;AGENZIE;UNKNOWN;PRODUZIONE aagdbp01.mydomain.it;asampsp;Novell IM Agent;AIX;PRODUZIONE;AGENZIE-;A +IX 5-3;PowerPC_POWER6;UNKNOWN;UNKNOWN;UNKNOWN;PRODUZIONE-ND aagbp01.mydomain.it;gsionline;Web Server;AIX;PRODUZIONE;AGENZIE-;AIX 5 +-3;PowerPC_POWER6;UNKNOWN;UNKNOWN;UNKNOWN;PRODUZIONE-ND '; my $file2 = 'aagdbp01:01:SVC.OPCON:opcon aagdbp01:35:GEN.QMSAG:mqm:QP1GA aagdbp01:36:AGENZIA.PICOOCL:picoOCL '; open (FILE2, '<', \$file2) or die "Can't open file2 - $!\n"; print "File2 search terms are:\n"; while (<FILE2>) { chomp; my ($string1, $string2) = (split /:/)[-2,-1]; printf "%-20s %-10s\n", $string1, $string2; } =prints..... File2 search terms are: SVC.OPCON opcon mqm QP1GA AGENZIA.PICOOCL picoOCL =cut
Question:
For example line2 of FILE1 has QP1GAGA1, should that match QP1GA?
Please explain very clearly which lines should be deleted from
FILE1 and why

In reply to Re: Compare 2 CSV files by two different column and printout by Marshall
in thread Compare 2 CSV files by two different column and printout by nicopelle

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.