#! perl -sw use strict; my $tabn = 8; my $tabc = '.'; #! Use a space, '.' is just for demonstration. while( ) { print; my $p; substr($_,$p,1) = $tabc x ($tabn - $p % $tabn) while ($p=index($_, "\t"))>-1; print; } __DATA__ the quick brown fox the quick brown fox the brown fox #### c:\test>203941 the quick brown fox the quick brown fox the quick brown fox ........the.....quick...brown...fox the brown fox ................the.............brown...........fox c:\test>