regex - no field seperator



Hi,

I have the following data that I'm trying to parse into an array. There are
19 fields but with hosts 5 & 6 fields 6 & 7 do not have any space between
them. This is how I get it from the OS and have no control over it.

The maximum length for field 6 is 7 chars and field 7 is 6 chars.

200508171648 host1.dom.com 0 0 14 2166 623 8 4 12 0 0 0 35 131 14 0 0 100
200508171648 host2.dom.com 0 0 0 265 7563 5 3 8 0 0 0 34 66 7 0 0 100
200508171648 host3.dom.com 0 0 0 461 8112 4 0 6 0 0 0 53 84 9 0 0 100
200508171648 host4.dom.com 0 0 0 46 9468 5 3 9 0 0 0 39 75 8 0 2 98
200508171648 host5.dom.com 0 1 0 7008342480 3 0 0 0 0 0 0 41 8 0 2 98
200508171648 host6.dom.com 0 1 0 8936445548 3 0 0 0 0 0 0 14 5 0 0 100

I have tried the following, and several other combos, with no luck. It
matches the first 4 lines but fails for the last 2 because they appear to
have only 18 fields I assume.
@oput = /(\d+) (.+\..+\..+) (\d+) (\d+) (\d+) (\d{2,7}) (\d{2,6}) (\d+)
(\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+) (\d+)/;

Can someone point me in the right direction please?

Thanks Greg.


Relevant Pages

  • RE: regex - no field seperator
    ... >> I have the following data that I'm trying to parse into an array. ... >You say it is a total of 13 characters, but in this case you have 10 ... Prev by Date: ...
    (perl.beginners)
  • initialize array within a class by a class member
    ... I want to define an array of class Date based on another member ... How do I initialize the dateArray in without knowing no of dates? ... Greg ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: initialize array within a class by a class member
    ... When we initialze a month, we know the no of dates in that month, so ... base on that we can create a array of the right size for each date of ... Greg ... Prev by Date: ...
    (microsoft.public.vc.language)
  • Re: Parsing a chemical formal
    ... > portion of single atoms ... > Beginning letter of a element ist written in upper case. ... > capital letter will be pushed in a temporary Array. ... It can parse formulas like the ...
    (comp.lang.perl.misc)
  • Re: Vinum raid5 problems......
    ... Greg 'groggy' Lehey wrote: ... and then allow me to traverse the array. ... Vinum List: ... Kernel dumps will be supplied later today or tomorrow - i'm not going to ...
    (freebsd-questions)