# Mark chapters /^ *([IVX][IVX]*)\.* *$/ { gsub(/ */, "") gsub(/\./, "") print "" print "# Kapittel " $0 print "" next } { print }