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) +}@_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tab Stop Converter
by davido (Cardinal) on Sep 29, 2003 at 06:34 UTC | |
|
Re: Tab Stop Converter
by atcroft (Abbot) on Sep 29, 2003 at 06:37 UTC | |
|
Re: Tab Stop Converter
by jmcnamara (Monsignor) on Sep 29, 2003 at 22:11 UTC | |
|
Re: Tab Stop Converter
by bsb (Priest) on Oct 02, 2003 at 08:48 UTC |