while ( ) { chomp; $_ =~ s/^\d+//; print FH2 $_, "\n"; # to get it into a new file }