my %skip=map {$_=>1} qw(CPXX1 KLXX1 KMXX1 MEXX1 PAXX1 PMXX1 SLXX1 SZXX1 WXXX1 YZXX1); while ( ) { print OFILE unless $skip{substr($_,0,5)}; }