perl -pe 's/(Host System [^#].+)|.+/$1/gs' records.txt [download]
In reply to Re^3: Pattern problem by Mago in thread Pattern problem by Anonymous Monk