Just off the top of my head:

my @records = ();
while($_ =~ /(.{10})(.{15})(.{40})/g){
  push(@records,[$1,$2,$3]);
}

Or soemthing like that.  It basically matches 10 characters followed by 15
characters followed by 40 characters and then pushes the fields to an array
of arrays so that you have them later.

-----Original Message-----
From: Christopher M Burger
To: [EMAIL PROTECTED]
Sent: 2/4/03 7:51 AM
Subject: parsing a datafile.

I was wondering if anyone had any ideas on how to parse a datafile with
fixed length records but no carriage returns.  All records are on one
line.
There are 3 fields per record the first is 10 spaces, the second is 15
and
the third is 40 then it starts back with 10 again.

Any help would be appreciated.

Chris Burger



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

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

Reply via email to