I need to read some data from an input file.  I have a regex that picks
out just numbers from the file, but I can't seem to be able get the ones
I want.

Here is the code I wrote:

open (KA, "K.a") || die                 #reads file "K.a"
 "can't open K.a: $!";

LINE: while (<KA>) {                 #reads a line until EOF
 chomp;                                        #strips newline character

 next LINE if /^>/;                        #skips lines beginning with
'>' used for comments for these files
 if ( /ssA:/) {                                 #looks for proper
parameters
  push (@parms, /(-?\d+\.?\d*)/); #reads in digits (works fine)
 }

}

($eqnum, $h, $s, $p) = @parms;   #sets parameter values to elements of
array
print ("$eqnum, $h, $s, $p");

Here is the out put I get:
, , ,

Here is what I want to get:
1, -35, 9.0, 1
(The parameters from the field 'ssA:')

Sorry about the format of the input file, the formatting from the text
editor didn't translate.  Any help would be enormously appreciated.

Thanks,

Mark Flynn
Research Fellow
UT-Houston Medical School


This is the input file I need to read from:

  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  >>    module's name: A  >>
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
A:  >  Activation function (time constant method) >
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>------------------------------->--------------------------------------->

>    >     >
> 1   > A = ssA   (1) >
>    >     >
>------------------------------->--------------------------------------->

 2   >         ssA - A   >
 -1 >IV<  > dA/dt= ------------ (2) >
    >            tA   >
>------------------------------->--------------------------------------->

  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ssA:  >  Steady state value for activation  >
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>----------------------->------------------------------------------------------>

     1                  >   1          >
     -35.0         >-35 h< > ssA = --------------------  (1)    >
       9.0           >9 s< >  +-      -+ p         >
     1                  >1 p< >  |     (h-V)/s |          >
                       >  |1 + e        |          >
                           >  +-      -+          >
                       >             >
>----------------------->------------------------------------------------------>

> 2  >     1 - An          >
> 0.0001 >An< > ssA = -------------------- + An         >
> 0.0002 >h< >  +-      -+ p         >
> 0.0003 >s< >  |     (h-V)/s |   (2)    >
> 0.0004 >p< >  |1 + e        |          >
>   >  +-      -+          >
>----------------------->------------------------------------------------------>



  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
tA:  >  Time constant for activation   >
  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>----------------------->------------------------------------------------------>

>   >             >
> 1  > tA = tx         (1)>
> xxxx.xx >tx< >             >
>----------------------->------------------------------------------------------>

 2  >   tx -tn           >
    0.04    >.04 tx< > tA = -------------------- + tn             (2)>
    0.004  >.004 tn< > +-      -+ p          >
  -20.0      >-20 h< > |     (V-h)/s |           >
   10.0       >10 s< > |1 + e        |           >
    1        >1 p< > +-      -+           >
   >             >
>----------------------->------------------------------------------------------>

> 3  >    tx -tn          >
>   0.05      >.05 tx< > tA = ----------------------------------- +
tn     (3)>
>   0.003     >.003 tn< > +-      -+p1 +-        -+p2        >
>  -31.0      >-31 h1< > |   (V-h1)/s1 |   |   (V-h2)/s2 |        >
>   12.0       >12 s1< > |1+e          |   |1+e          |        >
>   1       >1 p1< > +-      -+   +-        -+        >
>   -58.0     >-58 h2< >             >
>   -11.0     >-11 s2< >             >
>   1       >1 p2< >             >
>----------------------->------------------------------------------------------>

>   >   +--         -+        >
> 4  >   |   1 - rtn         |        >
> xxx.xx >tx< > tA = tx | -------------------- + rtn |            (4)>
> xxx.xx >rtn< >   | +-           -+ p        |        >
> xxx.xx >h< >   | |     (V-h)/s  |        |        >
> xxx.xx >s< >   | |1 + e         |        |        >
> x >p< >   | +-           -+           |        >
>   >   +--          -+        >
>   >             >
>----------------------->------------------------------------------------------>

>   > +--                   --+    >
> 5  > |  1 - rtn                    |    >
> xxx.xx >tx< > tA=tx | ---------------------------------- +rtn | (5)>
> xxx.xx >rtn< > | +-       -+p1+-       -+p2        |    >
> xxx.xx >h1< > | |   (V-h1)/s1|  |   (V-h2)/s2|          |    >
> xxx.xx >s1< > | |1+e         |  |1+e         |          |    >
> x >p1< > | +-       -+  +-       -+          |    >
> xxx.xx >h2< > +--                --+    >
> xx.xx >s2< >             >
> x >p2< >             >
>----------------------->------------------------------------------------------>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to