diff options
| author | Trygve Laugstøl <trygvis@inamo.no> | 2025-07-02 21:56:31 +0200 |
|---|---|---|
| committer | Trygve Laugstøl <trygvis@inamo.no> | 2025-07-02 21:56:31 +0200 |
| commit | bbb74be6a29708a8c50764e33fd759ab61a9f623 (patch) | |
| tree | 056f48f3cbb84f2925c792ac1bb4a14c6ef29b8e /convert2.awk | |
| parent | 69e958b51cdf33c53d10fb6f7788d9adb9846af0 (diff) | |
| download | constance-ring-bbb74be6a29708a8c50764e33fd759ab61a9f623.tar.gz constance-ring-bbb74be6a29708a8c50764e33fd759ab61a9f623.tar.bz2 constance-ring-bbb74be6a29708a8c50764e33fd759ab61a9f623.tar.xz constance-ring-bbb74be6a29708a8c50764e33fd759ab61a9f623.zip | |
wip
Diffstat (limited to 'convert2.awk')
| -rw-r--r-- | convert2.awk | 26 |
1 files changed, 25 insertions, 1 deletions
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 + } } |
