# charset="CP932" # encoding="CP932" # Tab を Space (長さ制限付き) に 伸張 #!/usr/bin/perl -wpi~ # JPerl 以外では Text::Tabs 使えよ # use diagnostics; use strict; BEGIN { $tabstop ||= 8; } 1 while s/^([^\t]+)(\t+)/ $1 . "\x20" x (length($2) * $tabstop - length($1) % $tabstop) /em; __END__ #!/usr/local/bin/gawk -f BEGIN { tabstop = 8; spaces = " "; } { while (match($0, /\t+/)) sub(/\t+/, substr(spaces, 1, RLENGTH * tabstop - (RSTART - 1) % tabstop)); print; }