1833055 Members
2475 Online
110049 Solutions
New Discussion

Awk extraction with test

 
SOLVED
Go to solution
Leo The Cat
Regular Advisor

Awk extraction with test

Hi Guys


How to return only DBX here flag is not N from my file below (Example).

DB1:/su01/app/oracle/product/10203/db:W
DB2:/su01/app/oracle/product/10203/db:Y
DB3:/su01/app/oracle/product/10204.2/db:Y
DB4:/su01/app/oracle/product/10203/db:N
DB5:/su01/app/oracle/product/10203/db:N
DBTEST1:/su01/app/oracle/product/10203/db:Y

Result must be

DB1
DB2
DB3
DBTEST1


Thanks in advance

Bests regards
Den
2 REPLIES 2
Earl_Crowder
Trusted Contributor
Solution

Re: Awk extraction with test

awk -F':' '!/^#/ && NF==3 && $3!="N"{print $1}'
Leo The Cat
Regular Advisor

Re: Awk extraction with test

Earl answer is good !