I’ve written a Perl script which will split text into fixed-width strings of text. If there are any issues with this script, please let me know.
The documentation for the script is as follows:
DESCRIPTION splitlines.pl - Simple Perl script to take incoming arbitrary text and output it in fixed-width lines, each at a user-specified length. SYNOPSIS splitlines.pl [-f|--file <File to Read Input From>] [-l|-s|--length|--size <Size for Each String>] [<Size for Each String>] OPTIONS -f, --file <File to Read Input From> Specifies the file to read input text from. The file at the specified path must be readable by the current user running this script in order for this script to be able to parse its input into separate fixed-width lines. -l, --length, -s, --size <Size for Each String> Specifies the number of characters that should be in each outputted line. ENVIRONMENT VARIABLES This script supports the use of the following environment variables: SPLITLINES_LINE_SIZE Specifies the number of characters that should be in each outputted line, similar to -l or -s (or their long forms). INPUTTING STRING SIZE If the size for each string is not explicitly specified by a command-line option or command-line argument, the script will prompt the user to input it during the operation of splitting the arbitrary text. AUTHOR Jeffrey Meyer <email@example.com>, 2016-2017 splitlines.tgz (1.1KB)