#!/usr/bin/awk -f # Downloadable example 3 for GNU Awk Part 15 { if ($NF == "-") { $NF = "" line = $0 getline print line $0 } else { print $0 } }