I'd like to print long console lines as pages which are below each other.
For example
AAAAAAABBBBBBBXX
CCCCC
DDDDDDDEE
FFFFFFFGGGGG
IIII
should be displayed as
AAAAAAA
CCCCC
DDDDDDD
---
BBBBBBB
EE
---
XX
===
FFFFFFF
IIII
---
GGGGG
===
instead of wrapping lines. Basically for a fixed number of lines ("chunk") and if there are line widths beyond a certain column, a new "page" should be created and displayed on the console. It should be done on chunks of lines, to avoid that for many lines the "pages" appear at the very bottom. Also there may be multiple "extension pages" needed, if the line are very long ("XX" in this example). Note that at the end, empty lines may be added in the input to have a complete chunk of data. "---" are page separators and "===" a chunk separators.
The basic idea is that display something like tabular data aligns. Is there an easy way to do that?