Subject: | |
From: | |
Reply To: | VANCE,JEFF (HP-Cupertino,ex1) |
Date: | Mon, 19 Jun 2000 14:42:45 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
I'm not sure this is elegant, but here goes:
:setvar x '999 xxxxxxx yy y y,y, y'
:calc len(x)
24, $18, %30
:calc word(x)
999
:calc word(x,,2)
xxxxxxx
:calc rht(x,-delimpos(x,,2)-1)
yy y y,y, y
> I'm working on a mpe script blah blah
> blah and i have a string in the following format: # xxxxxx
> yyyyyyyyyy
> where # is a number
> xxxxx is something but there are no spaces in it (variable
> length)
> yyyyyy is also something but there may or may not be
> spaces in it (variable length)
>
> obviously, using the word function to extract # and xxxxx is
> a piece o'cake. i'm wondering though about extracting
> yyyyyy. word isn't going to give me what i want because of
> the possibility of spaces (or other default delimiters).
> currently i'm letting word tell me where xxxxx ends,
> determining the length of the entire string and calculating
> the difference to determine the beginning position of yyyyy
> and it's length. it certainly works, but is rather low on
> the elegance scale. any suggestions for something more
> elegant/wonderful? - d
HTH,
Jeff Vance, CSY
|
|
|