in reply to Re^4: handling tab delimited files
in thread handling tab delimited files
how should i put it back together?
You could write
foreach my $val (@values){ $val *= $df * 50 ; } print join("\t", @values), "\n";
This would modify the values in-place in the array (because $val is an alias for the respective elements in the array), so you can simply join them with a tab after the for loop.
Or shorter, with map:
print join("\t", map { $_ * $df * 50 } @values), "\n";
or maybe even
... while (<FILE>){ print join("\t", map { $_ * $df * 50 } split /\t/), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: handling tab delimited files
by shaludr (Initiate) on May 05, 2010 at 20:41 UTC | |
by almut (Canon) on May 05, 2010 at 21:01 UTC | |
by shaludr (Initiate) on May 06, 2010 at 05:49 UTC | |
by toolic (Bishop) on May 05, 2010 at 20:52 UTC |