perl -pe 's/(Host System [^#].+)|.+/$1/gs' records.txt