view tools/incpri.pl @ 571:d78f78ff50d1

*** empty log message ***
author kono
date Thu, 12 Jan 2006 13:56:44 +0900
parents a379da780856
children e055df7c1082
line wrap: on
line source

#!/usr/bin/perl

for(@ARGV) {
    my $filename = $_;
    rename($filename,$filename.".bak");
    open(IN,"<$filename.bak");
    open(OUT,">$filename");
    $d = "0000";
    while(<IN>) {
       s/printf\(\"\#\d+\:/printf\(\"\#$d\:/;
       s/printf\(\"([^#])/printf\(\"\#$d\:$1/;
       $d++;
       print OUT;
    }
}