oops sorry for the last mail...i pressed the enter button
inadvertently.
neways here is the problem...

File1:example.txt

ProbeNames      Exp1    Exp2    Exp3    Exp4    Exp5
244901_at       24.3    46.4    37.4    19.5    59.6
244902_at                       36.6    92.4    49.5    42.4          29.6
244903_at                       46.4    19.4    -       18.2    19.8
244904_at                       56.2    29.4    78.4    37.8    -

ok Exp is the experiment name..Probes are under the ProbeNames and the
digits are the signal values..

i want to find the average value for each Probe i.e each horizontal
line.For ex:Avg value for 244901_at is so and so,avg value for
244902_at is so and so..

so what i did is took out the first line and the first column and used
split on  the values.My code is as follows:

----------------------------------------------------------------------------------------------------------------------------------------------------------------

#!/usr/bin/perl -w

$file1="mini.txt";
$output1="output1.txt";

open(FILE,"<$file1")or die "Unable to open file";
open(OT1,">$output1")or die "Unable to open file";

$count=0;
$totalcount=0;
$total=0;
while($line=<FILE>)   #reading each line in the file.
     {
      chomp($line);
      if(!$count==0)
     {
      $line =~ s/"//g;       #taking out the delimiters(Quotations)
      my @fields=split(/\t/,$line); #getting a list of values.
         foreach $fields(@fields)
               {
                if ($fields=~ m/_at/){}
                else
                {
                print OT1 "$fields\n";
                }
               }
    }
    $count++;
}
close(FILE);
close(OT1);

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
what do i do next??


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to