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
In reply to Re^2: array in different columns
by Muflone82
in thread array in different columns
by Muflone82
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |