Concatenate with a set number of spaces or tabs at the start of each line.
To be honest, this is just an excuse to make a small filter in C. It's easily done with a number of existing tools (awk, sed, perl). This might make it slightly more convenient than those tools, but really, I just wanted to write something small in C.
spacecat [-h] [-c COUNT] [-n] [-r] [-s] [-t] [FILE ...]
If the -t option is given, hard tabs will be used instead of spaces. If the -c option is given, then the number of spaces or tabs can be specified. Without options, the default is to output four spaces at the start of each line. If -t is given with no explicit count, one tabstop starts each line. The -n option adds line numbers to the output. -s squeezes consecutive blank lines: only the first will appear in the output. -r removes all blank lines from the output.
Should be as simple as make. Then just pop it into ~/bin. I've tested on OSX, OpenBSD and Debian. If you have trouble building it, please let me know.
If you have ronn—and you really should—you can also get a manpage and HTML manpage. Just run make man.
None found so far, but I have no doubt they're in there. Please let me know if you find any.
I'm a novice C programmer. Don't use this in any mission-critical copy/paste situations.
Manpage made with Ronn.
Copyright (c) 2012-2020 Peter Aronoff, MIT License. See LICENSE for details.