fork download
  1. #!/bin/bash
  2. # your code goes here
  3.  
  4. awk 'match($0,/^NAME\([^)]*/){name=substr($0,RSTART+5,RLENGTH-5);next} match($0,/IP\([^)]*/){print name,substr($0,RSTART+3,RLENGTH-3);name=""}'
Success #stdin #stdout 0s 4356KB
stdin
NAME(BOLIVIA)              TYPE(SA)
APPLIC(Java)                 IP(192.70.xxx.xx)
NAME(BOLIVIA)              TYPE(SA)
APPLIC(Java)                 IP(192.71.xxx.xx)
stdout
BOLIVIA 192.70.xxx.xx
BOLIVIA 192.71.xxx.xx