Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^7: Adding object identifiers corresponding to matched headers and sub-headers.

by Melly (Hermit)
on Jan 18, 2007 at 15:00 UTC ( #595264=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Adding object identifiers corresponding to matched headers and sub-headers.
in thread Adding object identifiers corresponding to matched headers and sub-headers.

K, have you seen the code I offered you at: Re^9: Adding object identifiers corresponding to each IP and printing them to O/P File.?

map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
Tom Melly, pm@tomandlu.co.uk


Comment on Re^7: Adding object identifiers corresponding to matched headers and sub-headers.
Download Code
Re^8: Adding object identifiers corresponding to matched headers and sub-headers.
by Kiran Kumar K V N on Jan 19, 2007 at 12:42 UTC

    Hi Melly,

    But the new Scenario I am mentioning over here is completely different. I am unable to transform the Logic of your code to write the new code for the current Scenario over here.

    Would be really thankful to you if you could please spare some of your most valuable time in assisting me for the same. I may sound like "Pls write the code or Script for me", but I can't help myself. This approach may surely appear to be shameless on my part, even I do understand. But I am in real soup and am really getting messed up right now.

    Confirming this as my last request for the same.

    Thanks a lot in advance.

    Warm Wishes and Best Regards,

    K.

      Kiran Kumar K V N,

      A little bit of advice. Adding object identifiers corresponding to matched headers and sub-headers. reads like a poorly written functional spec. I accept that there are language barriers, but I do not believe them to be a big factor in this issue. You have essentially posted a request for someone else to produce working code based purely on your requirements. Around here the kind folk offer help and advice free of charge. It is a little insulting (repeatedly) asking people to do (what I assume) is a work related task you are being paid to do.

      If you are new to Perl, check out the Tutorials section of this site. There are tutorials ranging from "hello world" type lessons right up to some pretty advanced concepts.

      "I am unable to transform the Logic of your code to write the new code for the current Scenario over here."

      What have you tried? Do you have any Perl code to show us? Seriously, making a little effort helps. Break down the task into small stages (as jZed advised here) and work on each part. If you get stuck, post (take into account the advice I previously gave you) the code and a description of the problem.

      Hope this helps

      Martin

      In for a penny, in for a pound... what's the problem? Is it just specifying the files to be read or something else?

      map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
      Tom Melly, pm@tomandlu.co.uk

        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://595264]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (13)
As of 2014-10-30 23:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (211 votes), past polls