#!/bin/bash awk ' /^Node/ { node = $2 next } / *Coeff/ { gsub(/^ *Coeff /, "") gsub(/:/, "") print node " " $0 } ' "$@"