extract from array with awk and sed