my $FILENAME4 = "organized.txt";
open(DATA2, $FILENAME4);
####
my $FILENAME4 = "organized.txt";
open DATA2, '<', $FILENAME4 or die "Cannot open '$FILENAME4' $!";
####
#remove all previous re-organized files
my $remove_reorganized = "re-organized.txt";
if (unlink($remove_reorganized) == 1) {
print "Existing \"re-organized.txt\" file was removed\n";
}
#now make a file for the ouput
my $outputfile = "re-organized.txt";
if (! open(POS, ">>$outputfile") ) {
print "Cannot open file \"$outputfile\" to write to!!\n\n";
exit;
}
####
# make a file for the ouput
my $outputfile = "re-organized.txt";
open POS, '>', $outputfile or die "Cannot open file '$outputfile' to write to because: $!";
####
$organized =~ s/(\w+)[^(^\d+)(\s)]/z/g;