not parsing correctly
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 Quote:
Quote:
|
it should be "==" and not "=" in your if statement. Furthermore, there's no need for "if" either
Code:
awk '$2=="D"{print $1]' file |
All times are GMT -5. The time now is 10:34 PM. |