Hi to all.

I've got two files, file1 and file2. file1 is bigger than file2 and looks like this:

machine;subsystem;name;..;..;..;..;..;..;..; ............. aagdbp01.mydomain.it;PatrolAgent_3181;Patrol Agent;AIX;PRODUZIONE;AGEN +ZIE-;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 aagdbp01.mydomain.it;gsionline;Web Server;AIX;PRODUZIONE;AGENZIE-;AIX +5-3;PowerPC_POWER6;UNKNOWN;UNKNOWN;UNKNOWN;PRODUZIONE-ND .....

and so on.
(More or less 6k lines of data CSV.) The second file, file2, is smaller (more or less 1k lines), and looks like this:

hostname:priority:classname:string1:string2 ..... aagdbp01:01:SVC.OPCON:opcon aagdbp01:35:GEN.QMSAG:mqm:QP1GA aagdbp01:36:AGENZIA.PICOOCL:picoOCL .....

and so on.
I would matching two files (compare file2 with file1) with the criteria below described:
read every line of file2 and for every lines, IF (string1 OR string2) =~ m/subsytem/ AND hostname =~ m/machine/ then SKIP to next line. The final result would be "file1's lines" substracted by "file2's lines" that would respect the above criteria.
Thanks to anyone who wants to spend some time with my silly problem, NicK.


In reply to 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.