I also tried using sprintf, but if the data is longer than intended, the line becomes too long.
You do know you can specify the maximum width?
printf "%2.2s>%32.32s<\n", $_, 'x' x $_ for 30 .. 34, 99..101;; 30> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 31> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 32>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 33>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 34>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 99>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 10>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx< 10>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<
In reply to Re: Format, empty vars, and fixed-width records
by BrowserUk
in thread Format, empty vars, and fixed-width records
by kwaping
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |