The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-28-2008
dyrt dyrt is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 1
question about grep, cut, and piping

Howdy folks,

I am fairly new to scripting but have lost of expirience in c++, pascal, and a few other. I am trying to complete a file search script that is sent a file name containing data to search that is arranged like this

"id","name","rating"
"1","bob","7"
etc

and an argument to search such as name=bob. My problem is that id and rating are both numerical so a simple grep won't work, so i need to search the correct field for the correct data. i need to then run a script(which i have already written and tested to work) that will accept the line numbers and the file name to print the lines that match. It is there where i am stuck.

Any suggestions how i can correctly print only the lines where the correct field matches? i can just forget the print lines script if there is an easier way that i missed. thanks for any help!

Mike