in reply to Re: array in different columns
in thread array in different columns
No, this isn't a homework but the final part of a script.
The result of my script is an array like this:
@array=(--, 0.0175, 0.0483, 0.0507, --, 0.0471, 0.0483, --, 0.0287, --)the length of the array can be differ; depend by the input file
so if I print this array I obtain:Instead I hope to have:print @array; -- 0.0175 0.0483 0.0507 -- 0.0471 0.0483 -- 0.0287 --
So I tried to insert the array inside a variable and then split it into array0 0.0175"\t"0 0.0483"\t"0.0471"\t"0 0.0507"\t"0.0483"\t"0.0287"\t"0
but I obtain:my $fileAverage = join "", @array; $fileAverage =~ s/--\n/--0\n/g; my (@matrix) = split('--', $fileAverage); foreach my $lane (@matrix) {print "\t$lane"; }
"\t"0 0.0175 0.0483 0.0507 "\t"0 0.0471 0.0483 "\t"0 0.0287 "\t"0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: array in different columns
by Corion (Patriarch) on Nov 23, 2016 at 10:33 UTC | |
by Muflone82 (Novice) on Nov 23, 2016 at 11:08 UTC | |
by Corion (Patriarch) on Nov 23, 2016 at 11:31 UTC | |
by Muflone82 (Novice) on Nov 23, 2016 at 11:52 UTC | |
by poj (Abbot) on Nov 23, 2016 at 13:36 UTC | |
| |
|
Re^3: array in different columns
by Muflone82 (Novice) on Nov 23, 2016 at 10:38 UTC |