#!/usr/bin/awk -f BEGIN { c = "" } /^##/ { c = substr($0,4); } /^#Server/ { if( c==COUNTRY ) { print substr($0,2); } }