linseyr has asked for the wisdom of the Perl Monks concerning the following question:
But the problem is the array. How do I get commas between the numbers? And at the end calculate the average from the array? Thanks!#!/usr/local/bin/perl #OPEN UP THE FILE open (MYFILE, '148-N-pvalue0.01_peaks.xls'); #READ THROUGH THE FILE while (my $line = <MYFILE>) { @arr1 = split('\t',$line); @length = @arr1[3]; $numbers = join(", ",@length); print $numbers; #print @length,","; #$avg = avg($length); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: average of column
by toolic (Bishop) on Sep 12, 2012 at 15:01 UTC | |
|
Re: average of column
by daxim (Curate) on Sep 12, 2012 at 15:01 UTC | |
by linseyr (Acolyte) on Sep 12, 2012 at 15:08 UTC | |
by Kenosis (Priest) on Sep 12, 2012 at 16:34 UTC | |
|
Re: average of column
by pvaldes (Chaplain) on Sep 12, 2012 at 18:18 UTC | |
|
Re: average of column
by BillKSmith (Monsignor) on Sep 12, 2012 at 16:24 UTC | |
|
Re: average of column
by frozenwithjoy (Priest) on Sep 13, 2012 at 05:27 UTC |