Category: | text processing |
Author/Contact Info | hash h4sh@globo.com |
Description: | Code usefull to edit files automaticly removing the last "." in the selected string lines. |
#!/usr/bin/perl # Get files and skip "." in the selected strings. # jeffa is right. killlastdot.pl :) # Usage: ./killlastdot <ENTER> file word my $FILE = <STDIN> ; chop $FILE ; my $VAR = <STDIN> ; chop $VAR ; open(GETARQ, "$FILE") ; my @ARQ = <GETARQ> ; close(GETARQ) ; foreach (@ARQ) { if ($_=~/$VAR/) { my $x = $_ ; chop($x) ; chop($x) ; print "$x\n" ; } else { print $_ ; } } |
|
---|
Replies are listed 'Best First'. | |
---|---|
(jeffa) Re: ident.pl
by jeffa (Bishop) on Aug 01, 2003 at 02:27 UTC | |
by sauoq (Abbot) on Aug 01, 2003 at 03:12 UTC | |
by Aristotle (Chancellor) on Aug 02, 2003 at 20:58 UTC | |
by hash (Scribe) on Aug 01, 2003 at 14:24 UTC |
Back to
Code Catacombs