#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2014
    Posts
    1
    Rep Power
    0

    Question Matching different colums with awk


    HI,

    I have the following two files.

    The first file is :

    3184 2014-07-28 04:15 global.Remote-Access FW1 10.111.8.25 81.245.6.25 tcp 3268

    3035 2014-07-28 04:16 global.Remote-Access FW1 10.111.8.12 81.245.6.25 tcp 3268

    The second file is:

    1 Jul 28 04:12 2014-07-28 id967254(group3)[attribute1 attribute2]
    Tunneling: User with IP 10.111.8.12 10 connected

    1 Jul 28 04:15 2014-07-28 id920767(group2)[attribute3 attribute4 ....
    attribute n] Tunneling: User with IP 10.111.8.25 connected

    1 Jul 28 04:16 2014-07-28 ID926072(group3)[attribute1 attribute2]
    Tunneling:User with IP 10.111.8.12 connected

    If the source IP address in the file 1 is equal to file 2 , and if the time (hh:mm) and date (yyyy-mm-dd) in the file 1 are equal to file2, the third file will be as follows:

    3184 04:15 2014-07-28 global.Remote-Access FW1 id920767(group2)[attribute3 attribute4 .... attribute n] 10.111.8.25 81.245.6.25 tcp 3268

    3035 04:16 2014-07-28 global.Remote-Access FW 1ID926072(group3)[attribute1 attribute2] 10.111.8.12 81.245.6.25 tcp 3268

    How can I realise this using awk? because i am not good...

    Could you explain in details, please?

    Rgds
    FXSME
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    867
    Rep Power
    391

    Thumbs down


    And what have YOU tried?

    Did you post correct data for file 2 ? are the lines actually "wrapped" in the file or it's just you copied/pasted incorrectly.


IMN logo majestic logo threadwatch logo seochat tools logo