Hi All,
I have a file which contains the following data.
I basically want to extract first field if the second field is 'D'
[HTML]
Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth &
Name.......... Number Definition... Code........ Heading........ Format Assoc..
@ID D 0 H_ID 10L S
CURRENT_DT D 0 CURRENT_DT 40L S
DAY_ID D 1 TIME_DAY_ID 40R S
@KEY PH CURRENT_DT
@ PH CURRENT_DT
DAY_ID
ID.SUP
5 records listed.
[/HTML]
For this I am using the followign code
Code:
awk -F' ' '{if ($2="D") print $1;}' filename
But I get the following result.
Quote:
Type
Field.........
Name..........
@ID
CURRENT_DT
DAY_ID
@KEY
@
DAY_ID
ID.SUP
5
|
where as this is what I am expecting.
Quote:
@ID
CURRENT_DT
DAY_ID
@KEY
|