Find the answer to your Linux question:
Results 1 to 7 of 7
hi everyone, i do work interview and thay gave me a exercise on linux. i dont have a clue in linux. please please help me i need help! this is ...
  1. #1
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    parse log file-please help

    hi everyone,

    i do work interview and thay gave me a exercise on linux.
    i dont have a clue in linux.
    please please help me i need help!

    this is the exercise :

    structure:

    id,name,title,cate,type,phone

    in this file 12345.log have 1000 records (3 in the example)

    2312323¶dan¶sport¶20¶65¶089-827266
    1234323¶ram¶newss¶19¶65¶049-827266
    1234323¶sami¶nana¶19¶65¶023-827266

    a.from the file 12345.log need to show only the records in name "dan"
    b.from the file 12345.log need to show only records name = dan and title=sport

    tnx alot!!

  2. #2
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    hi,

    im not sure the forum rules allow us to do this for you but since you might be in a hurry i will do it for you(am i going to jail tonight)

    a)
    Code:
    awk -Fs '{if($2 == "dan") print}' 12345.log
    replace the s after -F by the separator in the file. here i cant see the correct separator character.


    b)
    Code:
    awk -Fs '{if($2 == "dan" && $3 == "sport") print}' 12345.log
    Linux and me it's a love story

  3. #3
    Just Joined!
    Join Date
    May 2008
    Posts
    3

    Tnx Alot

    tnx!!!

    i love u!

  4. #4
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Do you think the job is right for you if it requires Linux experience and you "don't have a clue in linux"?

  5. #5
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    scm i dont think that the job requires Linux experience because if it was the case they wouldnt give him/her such an easy test.
    Linux and me it's a love story

  6. #6
    Just Joined!
    Join Date
    May 2008
    Posts
    3
    this job don't need Linux experience.
    i am a .NET C# Programmer.

    this was one question from ten..

    thanks a lot!

  7. #7
    Linux Engineer khafa's Avatar
    Join Date
    Apr 2008
    Location
    Tokyo, Japan
    Posts
    858
    you welcome

    as a programmer some Unix/Linux experience will really broaden you chances (IMHO).
    Linux and me it's a love story

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...