This snippet turns tabs into "jump to the next multiple of four" padding. This is useful for programs in which tab-stops are hardcoded to a fixed location, rather than a fixed length. (Came out of a comment made by davido in the chatterbox.)
Update:
Two strokes of credited to davido ...
Update:
Modification to allow arbitrary tab stop length.
$_="1\t12\t123\t1234\t12345\t"; $s=4;split/\t/;print map{$_.=q/ /x$s;substr $_,0,$s*int(length($_)/$s) +}@_;
In reply to Tab Stop Converter by idsfa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |