in reply to how to place rows information into column (2)
in thread how to place rows information into column?
I wouldn't try to pattern match the scientific float... you could, but I think it's over-kill. If the data is tab delimited, then you can use that to distinguish the two values:
use strict; while(<DATA>) { # Get rid of trailing \n on line. chomp; # divide the line into two items based on tab my ($x, $y) = split("\t"); print "X:[$x] Y: [$y]\n"; } ##OUTPUT: # X:[0.000000e+000] Y: [1.502947e+000] # X:[1.162272e-012] Y: [1.508957e+001] # X:[2.324544e-012] Y: [1.508948e+000] # X:[0.000000e+000] Y: [1.502947e+001] # X:[1.162272e-012] Y: [1.508941e+001] # X:[2.324544e-012] Y: [1.508940e+000] # X:[0.000000e+000] Y: [1.503947e+000] # X:[1.162272e-012] Y: [1.504947e+000] # X:[2.324544e-012] Y: [1.508900e+001] ##NOTE in data the two fields are tab delimited. __DATA__ 0.000000e+000 1.502947e+000 1.162272e-012 1.508957e+001 2.324544e-012 1.508948e+000 0.000000e+000 1.502947e+001 1.162272e-012 1.508941e+001 2.324544e-012 1.508940e+000 0.000000e+000 1.503947e+000 1.162272e-012 1.504947e+000 2.324544e-012 1.508900e+001
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to place rows information into column (2)
by sh1tn (Priest) on Feb 02, 2005 at 23:20 UTC | |
by osunderdog (Deacon) on Feb 02, 2005 at 23:35 UTC |