lomSpace has asked for the wisdom of the Perl Monks concerning the following question:
The file that I am processing looks like this:#!/usr/bin/perl -w use strict; use Data::Dumper; # open a filehandle # file being read from open(my $in, "/Users/myDir/Desktop/hassan2.txt"); open(my $out, ">/Users/myDir/Desktop/hassan_out.txt"); while(<$in>){ my @fields = split /,/; my $field1 = $fields[0]; my $field2 = $fields[1]; print $out "$field1\t$field2\n"; } close($in); close($out);
And my output looks like this:"-0.500, 4.502e-6" "-0.499, 4.474e-6" "-0.498, 4.458e-6" "-0.497, 4.445e-6" "-0.496, 4.433e-6" "-0.495, 4.421e-6"
"-0.500 4.502e-6" "-0.499
-0.499 4.474e-6 -0.498 4.458e-6 -0.497 4.445e-6 -0.496 4.433e-6 -0.495 4.421e-6
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Invisible characters
by toolic (Bishop) on Feb 23, 2010 at 21:53 UTC | |
Re: Invisible characters
by ramlight (Friar) on Feb 23, 2010 at 22:11 UTC | |
Re: Invisible characters
by Marshall (Canon) on Feb 24, 2010 at 00:24 UTC | |
by lomSpace (Scribe) on Feb 24, 2010 at 19:26 UTC | |
by Marshall (Canon) on Feb 25, 2010 at 15:15 UTC |