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.