Unix command to extract a record from a table


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix command to extract a record from a table
# 1  
Old 11-13-2009
Lightbulb Unix command to extract a record from a table

Suppose there is a table like the following...I just wanted to know if there is any command using which we can get the record/name of the person who joined before 2005..

 
Sl Name des y.o.joining
1 Ram Engineer 2001
2 Hari Doctor 2004
3 David Plumber 2005
4 Rahim painter 2007
5 gurmeet driver 2009


Thanks......Smilie
# 2  
Old 11-13-2009
awk '$4<=2005{print $0}' <filename>
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

awk command to retrieve record 23 and 89 from UNIX file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file?... (6 Replies)
Discussion started by: rakeshp
6 Replies

2. UNIX for Beginners Questions & Answers

awk command to retrieve record 23 and 89 from UNIX file

Hi Everyone, I am looking for awk command to retrieve only the record number 23 and record number 89 from a unix file? Please let me know what is the awk command for this? Regards Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies

3. Shell Programming and Scripting

Help with Getting distinct record count from a .dat file using UNIX command

Hi, I have a .dat file with contents like the below: Input file ============SEQ NO-1: COLUMN1========== 9835619 7152815 ============SEQ NO-2: COLUMN2 ========== 7615348 7015548 9373086 ============SEQ NO-3: COLUMN3=========== 9373086 Expected Output: (I just... (1 Reply)
Discussion started by: MS06
1 Replies

4. UNIX and Linux Applications

UNIX spool command not extracting complete record from the Oracle table

Hello All, I'm trying to spool an oracle table data into a csv file on unix server but the complete record is not being extracted. The record is almost 1000 characters but only 100 characters are being extracted and rest of the data getting truncated. I'm setting below options : SET... (4 Replies)
Discussion started by: venkat_reddy
4 Replies

5. UNIX for Advanced & Expert Users

How can i populate the record in to table using shell scripting?

LOG_DIR=/app/rpx/jobs/scripts/just/logs sendEmail() { pzCType="$1"; pzTitle="$2"; pzMsg="$3"; pzFrom="$4"; pzTo="$5"; pzFiles="$6"; pzReplyTo="$7" ( echo "From: $pzFrom\nTo: $pzTo\nSubject: $pzTitle${pzReplyTo:+\nReply-To: $pzReplyTo}" ] && echo... (1 Reply)
Discussion started by: ankit.mca.aaidu
1 Replies

6. Shell Programming and Scripting

Extract timestamp from first record in xml file and it checks if not it will replace first record

I have test.xml <emp><id>101</id><name>AAA</name><date>06/06/14 1811</date></emp> <Join><id>101</id><city>london</city><date>06/06/14 2011</date></join> <Join><id>101</id><city>new york</city><date>06/06/14 1811</date></join> <Join><id>101</id><city>sydney</city><date>06/06/14... (2 Replies)
Discussion started by: vsraju
2 Replies

7. Shell Programming and Scripting

connecting to table to extract multiple rows into file from unix script

I need to extract the data from oracle table and written the below code. But it is not working.There is some problem with the query and output is shown is No rows selected" . If I run the same query from sql developer there is my required output. And if I run the shell script with simple sql... (7 Replies)
Discussion started by: giridhar276
7 Replies

8. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time then Go to sleep mode and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

9. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time (Go to sleep mode) and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

10. UNIX for Dummies Questions & Answers

how to read record by record from a file in unix

Hi guys, i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
Discussion started by: raoscb
1 Replies
Login or Register to Ask a Question