in reply to Text manipulation with perl
WOW, I am suprised so many have taken interest in my little problem, as requested here is where I am at right now with the code:
open(TXT,"$ARGV[0]") || die "Cannot open the $ARGV[0] file";
$instr = do{local $/; <TXT> };
close(TXT);
chomp($instr);
$instr =~ s/\n+/\n/g;
$instr =~ s/\-\s+([^\n]+)/\'$1\'\//g;
chop($instr);
open(TXT,">$ARGV[1]") || die "Cannot open the $ARGV[1] file";
print TXT $instr;
close(TXT);
Any suggestions? P.S. I didn't do this all by myself, but I at least understand what is going on.
|