5

Fetch entries with tags with editing in existing code

view full story
linux-howto

http://www.unix.com – Hi all I have to make some changes in the following code to fetch some more entries in the attached file. Code: awk 'k>0 {if (a[k] && k==2) { print a[1]":"a[2]":"a[3]; a[1]=a[2]=a[3]="";} a[k]=a[k]?a[k]" "$0:$0; k=0;} /^# Drug_Target_.*_Gene_Name/ {k=3;} /^# Generic/ {k=1;} /^# Brand_Name/ {k=2;} END {if (a[1]) print a[1]" "a[2]" "a[3];}' drug_bank.dat Using above code, I am able to fetch Drug target gene name and brand name and generic names in front of those targets name but I also want to fetch following ent (HowTos)