Thanks Jeff,
So changed the code to reflect your input
-
#!/usr/bin/perl
-
use strict;
-
-
my $fileInput='d:/temp/test.txt';
-
my $fileOutput='d:/temp/Newtest.txt';
-
-
open (READ, $fileInput);
-
open (WRITE, $fileOutput);
-
-
while(<READ>){
-
my $line=$_;
-
chomp($line);
-
$line =~ s/,/\./g;
-
print WRITE $line ."\n";
-
}
-
-
close (READ);
-
close (WRITE);
its still not running. the error I am getting (by running the tool from text pad)
print() on closed filehandle WRITE at D:\temp\find_replace.pl line 14, <READ> line 5.
print() on closed filehandle WRITE at D:\temp\find_replace.pl line 14, <READ> line 6.
etc, etc,etc
the data is tab delineated and looks something like this
1 24/9/2007 00:10:36 0,00 4,6931 48,23323 PL
1 24/9/2007 00:15:36 4,00 4,6931 48,23323 PL
1 24/9/2007 00:20:35 0,00 4,692167 48,23102 PL
1 24/9/2007 06:45:35 0,00 4,692167 48,23102 PL
1 24/9/2007 06:49:39 0,00 4,692167 48,23102 PL
1 24/9/2007 06:49:44 0,00 4,692167 48,23102 PL
the problem is whomever created this file put 'commas' in where the should have been periods.
should look like this
1 24/9/2007 00:10:36 0.00 4.6931 48.23323 PL
1 24/9/2007 00:15:36 4.00 4.6931 48.23323 PL
1 24/9/2007 00:20:35 0.00 4.692167 48.23102 PL
1 24/9/2007 06:45:35 0.00 4.692167 48.23102 PL
1 24/9/2007 06:49:39 0.00 4.692167 48.23102 PL
1 24/9/2007 06:49:44 0.00 4.692167 48.23102 PL
honestly, i don't care if I write to a new file too, just thought it would be easier.
Again thanks ahead of time for your help.
Eric