detab -- convert tabs to spaces two different ways


detab.pl is a perl program which detabs a text file using two different methods for converting tabs to spaces. The two methods are 1) a column-based mode which attempts to insert spaces to a "virtual" tab location and 2) a literal number of spaces per tab character.

Limitations

 

Example

For example, if you have text like
"Test[tab]some stuff"
then with 8 chars per tab, in column mode, you'll get
"Test^^^some stuff"
             ^
    column 8

...but in literal mode, you'll get
"Test^^^^^^^^some stuff"
        8 spaces


Back to Kent's Perl Page Last-modified: Sun Aug 10 12:11:33 EDT 2025