Perl has a substitute function - read the perldoc by doing "perldoc perlop" and search for "substitution" - you'll find a section that starts with
s/PATTERN/REPLACEMENT/egimosx
To substitute for both dot and comma, you'd need 2 substitute commands - one for each.
There's also a "transliteration" function like
tr/SEARCHLIST/REPLACEMENTLIST/cds
and can also be found in "perldoc perlop". Here's a little test I did with tr:
### tr (transliterate) example ###
my $c = "abc,def.ghi";
print "\$c before = <$c>\n";
print "\$c after = <$c>\n";
Output:
------
$c before = <abc,def.ghi>
$c after = <abc def ghi>
if you just want to *remove* the dot and the comma, then your tr would look like this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.