#!/usr/bin/perl use strict; my %csga = (); my $moyr="12/2014"; $,="\t"; open(IN,") { chop; @_ = split(/\t/); $csga{$_[0]}=$_[1]; } close IN; open(IN,"new_cc.txt"); for(my $i=0;$i<9;$i++) {$_=;} my ($mo,$yr)=@_ = split(/\//,$moyr); while() { chop; @_ = split(/\t/); my $created=pop(@_); my ($mocr,$day,$yrcr)=@_ = split(/\//,$created); if($yrcr.$mocr >= $yr.$mo) { my $cc=$_[1]; $cc =~ y/C_//d; splice(@_,3,1); shift(@_); print OUT $created,@_,$csga{$cc}; print OUT "\n"; } } close IN; close OUT; __END__ #### D:\PerlMonks>test2.pl D:\PerlMonks>