User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,127 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 335 | Replies: 1
Reply
Join Date: May 2008
Posts: 1
Reputation: vinz4ever is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
vinz4ever vinz4ever is offline Offline
Newbie Poster

searching for a record in a file

  #1  
May 11th, 2008
can pliz someone help, m trying to serach and display a record in shell scripting in linux

i have one data file n one source file. wat should write in the source[coding] file to to search for a record acording to a search pattern entered by a user...

the data file is like

9009709 Deo Vinit V IT Programmer 17/03/08
9207700 Benny Benson N HR Manager 20/06/07
..
..
............

wat should i write in my source file so that say user wants to search for record with number as 9009709 n then display the entire record for that number on the screen

i tried using awk n grep n sed but got confused....

pliz can someone help.....
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2005
Posts: 3,058
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 20
Solved Threads: 348
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: searching for a record in a file

  #2  
May 11th, 2008
awk '$1==9009709' file.txt
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 2:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC