From bbb74be6a29708a8c50764e33fd759ab61a9f623 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 2 Jul 2025 21:56:31 +0200 Subject: wip --- convert2.awk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'convert2.awk') diff --git a/convert2.awk b/convert2.awk index 9241ebc..9ca0dd4 100644 --- a/convert2.awk +++ b/convert2.awk @@ -1,3 +1,27 @@ +# awk { - print + if (match($0, /-$/)) { + # Drop line continuation + gsub(/-$/, "") + + # Print the line, without newline + printf "%s", $0 + + # Get the next line, skipping blank lines + do { + getline + } while($0==""); + + # Print the first word + printf "%s\n", $1 + + # Drop the first word, remove leading whitespace + $1="" + sub(/^[ \t]+/, "") + print + + next + } else { + print + } } -- cgit v1.2.3