Using find and replace on the tmap

One Star

Using find and replace on the tmap

I have a column of numbers, for example: 44,5555 and 234,5039 and 2099,2020. I am trying to figure out how to replace a " , " with a " . " I want to make these three numbers 44.5555 and 234.5039 and 2099.2020 using the tmap.
So far I have not been able to replace the comma with the period and keep the numbers too. Here are some formulas i have tried:
$row1 =~ s/,/./ when i use this i just get back the number < 1 > in all fields.
$row1 =~ s/,/./g when i use this i just get back the number < 1 > in all fields.
$row1 =~ s/,/./ ? "." : "" when i use this i just get back the number < . > in all fields.
$row1 =~ s/,/./g ? "." : "" when i use this i just get back the number < . > in all fields.
If anyone can help me out with this i would appreciate it.
Thanks,
David
One Star

Re: Using find and replace on the tmap

I created this routine
sub filemaskToRegex2 {
my ($filemask) = @_;
my $pattern = $filemask;
# *.log will be used as ^.*\.log$
$pattern =~ s{,}{.}g;
$pattern = ''.$pattern.'';
return $pattern;
}
1;
One Star

Re: Using find and replace on the tmap

I created this routine
sub filemaskToRegex2 {
my ($filemask) = @_;
my $pattern = $filemask;
# *.log will be used as ^.*\.log$
$pattern =~ s{,}{.}g;
$pattern = ''.$pattern.'';
return $pattern;
}
1;