perl question

From: Ioana Cozmuta <ioana.nas.nasa.gov>
Date: Fri, 20 Jun 2003 15:28:57 -0700 (PDT)

Hi,

I was hoping that someone could help me with the following problem. I have
a data file with 10 columns and I am reading the data in these columns in
matrices $Ai[$i], i=1..10 using a perl script (perl5.6.0)
 The problem is
that sometimes some of rows to not have 10 columns but 9 or 8 in which
case instead of having a zero value automatically assigned by the program
to the missing variables, the program reads the next variable. For example

0299_0490 BLOCK 1.6000 0 0 34614825 954 490 299 490
0299_0490 BLOCK 0 0 35018454 490 barcode 961 490

etc
The problem is that the fields do not have constant width and there is no
special label that occurs at the lines where there are less variables.

I just want to make perl read always 10 values no matter if there are only
9 or 8 present and assign zero values when there is no value present at a
certain position. The data are tab delimitated (this is what I use also in
the definition of split).

I would appreciate your help. Thank you,
Ioana


****************************************************************************
* Ioana Cozmuta, PhD * *
* NASA-AMES Research Center * "Gravitation can not be held responsible*
* Mail Stop 230-3 * for people falling in love" *
* Moffet Field,CA 94035 * *
* phone: (650) 604-0993 * Albert Einstein*
* fax: (650) 604-0350 * (1879-1955) *
****************************************************************************
Received on Fri Jun 20 2003 - 23:53:01 PDT
Custom Search