Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Programming & Scripting
Reload this Page parse log file-please help
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Programming & Scripting C, Perl, PHP, Bash Scripts, anything programming or script related post in here!

Reply
 
Thread Tools Display Modes
Old 05-16-2008   #1 (permalink)
avnic
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!!
avnic is offline   Reply With Quote
Old 05-16-2008   #2 (permalink)
khafa
Linux Enthusiast
 
khafa's Avatar
 
Join Date: Apr 2008
Location: Tokyo, Japan
Posts: 629
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
khafa is offline   Reply With Quote
Old 05-18-2008   #3 (permalink)
avnic
Just Joined!
 
Join Date: May 2008
Posts: 3
Tnx Alot

tnx!!!

i love u!
avnic is offline   Reply With Quote
Old 05-18-2008   #4 (permalink)
scm
Linux Engineer
 
Join Date: Feb 2005
Posts: 965
Do you think the job is right for you if it requires Linux experience and you "don't have a clue in linux"?
scm is offline   Reply With Quote
Old 05-18-2008   #5 (permalink)
khafa
Linux Enthusiast
 
khafa's Avatar
 
Join Date: Apr 2008
Location: Tokyo, Japan
Posts: 629
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
khafa is offline   Reply With Quote
Old 05-18-2008   #6 (permalink)
avnic
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!
avnic is offline   Reply With Quote
Old 05-18-2008   #7 (permalink)
khafa
Linux Enthusiast
 
khafa's Avatar
 
Join Date: Apr 2008
Location: Tokyo, Japan
Posts: 629
you welcome

as a programmer some Unix/Linux experience will really broaden you chances (IMHO).
__________________
Linux and me it's a love story
khafa is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:41 PM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0