Home » Infrastructure » Unix » Urgent require shell script to read a flat file
Urgent require shell script to read a flat file [message #109501] Thu, 24 February 2005 21:13 Go to next message
santosh
Messages: 85
Registered: October 2000
Member
I have a flat file MD1.txt like this:

Job_id Program_id Start_no End_no
J1 P1 10001 10050
J1 P2 10051 10100
J2 P3 10101 10150

I want to get Start_no and End_no based on Job_id and Program_id.

i.e i want a shell script get_range.sh so that on calling this like

$ get_range.sh MD1.txt J1 P2

The Output will be
10051 10100

Please help for it
Re: Urgent require shell script to read a flat file [message #110003 is a reply to message #109501] Wed, 02 March 2005 13:28 Go to previous message
ashok k rathi
Messages: 4
Registered: December 2004
Junior Member
grep '6 7' abc.txt | awk '{ print $3 $4}'
Previous Topic: Execute Oracle procedure from UNIX prompt
Next Topic: How to run a unix shell script in the background?
Goto Forum:
  


Current Time: Sat Jan 16 12:48:54 CST 2021