All pastes #503293 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-22 20:32 UTC
rendered paste body
#!/usr/bin/perl

open(FILE2, "text3.txt");
open(OUT,">output.txt");

while (<FILE2>){

        #print "processing $_";
        chomp;
        if($_ =~ /^=/){
                next;
        }
        if($_ =~ /^$/){
                next;
        }
        if($_ =~ /PAGE [0-9]+/){
                next;
        }
        if($_ =~ /CODE/){
                next;
        }
        if($_ =~ /D I A G N O S I S/){
                next;
        }
        $code = substr($_,0,5);
        $description = substr($_,7,63);

        $sql = <<END;
INSERT INTO MWDIA VALUES('$code', NULL, NULL, '$description', NULL, NULL, NULL, NULL, NULL, NULL )
END

        print OUT "$sql\n";

}



close(FILE2);
close(OUT);