#!/usr/bin/perl open(FILE2, "text3.txt"); open(OUT,">output.txt"); while (){ print "processing $_"; chomp; if($_ =~ /^=/){ next; } if($_ =~ /^\s*$/){ next; } if($_ =~ /PAGE [0-9]+/){ next; } if($_ =~ /CODE/){ next; } if($_ =~ /D I A G N O S I S/){ next; } $code = substr($_,0,7); $code =~ s/\s+$//; $description = substr($_,7,63); if($code =~ /^\s*$/){ next; } if($description =~ /^\s*$/){ next; } $sql = <