in reply to Text manipulation with perl
Any suggestions? P.S. I didn't do this all by myself, but I at least understand what is going on.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);
|
|---|