[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Specific fixed width question...
From: |
Sergei Steshenko |
Subject: |
Re: Specific fixed width question... |
Date: |
Tue, 14 Sep 2010 09:55:04 -0700 (PDT) |
--- On Tue, 9/14/10, fork <address@hidden> wrote:
> From: fork <address@hidden>
> Subject: Specific fixed width question...
> To: address@hidden
> Date: Tuesday, September 14, 2010, 9:41 AM
> Two lines of example data (notice
> that the county field (#4) is 25 characters
> wide and that spaces are used both between fields like WA
> and 053 and between
> parts of the county name, so you can't just split on
> spaces):
>
> WA 053 011 Clark County
> 45
> WA 053 027 Grays Harbor County 100
>
> I would like to parse out cntys=[11; 27] and data=[45; 100]
> from the above.
>
> I realize that I can pre-process the file outside of
> Octave, but I don't want to
> for various reasons (lack of access to real Unix tools,
> mostly).
>
GNU Octave has regular expressions support.
Regards,
Sergei.