Hi Melly,
We have the Log Data in 2 log files viz :- "File1.dat" and "File2.dat". The data in both the Files is as follows:
Need to perform the following operations and store the resultant output in the file "Output.dat".
The following to be done in both the files for the operations to be performed :-
1) In the first instance, we have to match the headers upto the first 4 positions and neglect the last 2 digits. For
eg:- we have the first headers respectively in both the files viz |8.2.0.4352.1.1|8.2.0.4352.1.1|0x3|10|2|105 and
|8.2.0.4352.1.1|8.2.0.4352.1.1|0x3|10|2|141. They are similar, as digits are same upto the first 4 positions.
Note :- Now as the first headers are same, we can only concentrate on these, as for rest of the matched headers, the
corresponding operations would be the same.
2) After this, we go for the second matching. Under each header, there are sub-headers. We compare the sub-headers.
There are 3 sub-headers in File1.dat viz:- 36242050|58, |38929186|58 and |33554850|58.
In File2.dat, the 3 sub-headers are :- |33554850|58, |36242050|58 and |36241938|58.
We compare the sub-headers for comparing the respective digits (irrespective of their Location like 1st, 2nd, 3rd
positions of each header) in both the Files.
For eg:- In File1.dat, the 1st and 3rd sub-headers viz.:- 36242050|58 and |33554850|58 exactly match respectively in
File2.dat, the 2nd and 1st sub-headers viz.:- |36242050|58 and |33554850|58.
Now we are done with the 2nd matching.
3) Object or Message Object is data (in the Form |5|1|6) in a Packet(a Networking Term). For eg:- |5|1|6 is one
Object. Similarly |5|1|66 is another Object and so on. Identifier is one of the component in the Message Object.
For eg:- in the Object |5|1|6, 5 is the first identifier, 1 is the second identifier and 6 is the third identifier.
There are 'N' number (N being a real number) of Message Objects (I have mentioned just 6) under each header and
sub-header.
Now the third operation being :-
For each matched sub-header for eg:- lets say 36242050|58 in both the Files, add the identifiers of objects
(ignoring the 1st and 2nd place identifiers which are always common and adding only the identifiers at the 3rd
place).
Request you to please give your very valuable Inputs.
Thanks and Regards,
KiranKumar K.