diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-08 10:45:17 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-08-08 10:45:17 +1200 |
commit | 94ad9332c0a8213ad384007707d68ac8fd1810cb (patch) | |
tree | 3c5993a3f987f6f8576af13f604d792288c4d785 /bin | |
parent | Restore ^L-skipping code (diff) | |
download | dotfiles-94ad9332c0a8213ad384007707d68ac8fd1810cb.tar.gz dotfiles-94ad9332c0a8213ad384007707d68ac8fd1810cb.zip |
Nicer handling of RFC control chars
Diffstat (limited to 'bin')
-rw-r--r-- | bin/rfct.awk | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/rfct.awk b/bin/rfct.awk index 5ceef43f..230ac42c 100644 --- a/bin/rfct.awk +++ b/bin/rfct.awk @@ -6,9 +6,12 @@ BEGIN { ORS = "\n\n" } -# Skip paragraphs with ^L chars in them -# We have to be literal here due to mawk's failures -// { next } +# Skip paragraphs with ^L chars in them, as they likely contain headers and +# footers +/\f/ { next } -# If there's anything left, print it +# Strip out other control characters, but allow newline and tab +{ gsub(/[\a\b\r\v]/, "") } + +# If there's anything left after tha, print it length($0) |