Subject: | |
From: | |
Reply To: | |
Date: | Mon, 24 Jul 1995 17:22:57 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On Jul 24, 7:32pm, Tony B. Shepherd wrote:
> Subject: Re: Word extraction CI evaluator function
I wrote:
> ] :setvar buf "ftp.iii.net/ftp/pub/pub-site/tbs"
> ] :calc word(buf)
> ] ftp.iii.net/ftp/pub/pub-site/tbs
> ]
> ] None of these characters are considered a word delimiter.
Tony replied:
> (No flames intended again) this makes it less than helpful for parsing
> filenames, etc. From the example above, it cannot be used to rip the
> group name from an MPE filename. Guess I'm having trouble appreciating
> the problem being solved, so I'll go stand in the corner :-)
I should have been clearer, so I'll try again...
:setvar buf "ftp.iii.net/ftp/pub/pub-site/tbs"
:calc word(buf)
ftp.iii.net/ftp/pub/pub-site/tbs <=== uses default word delims
:calc word(buf,'.') <==== specify the word delim is "."
ftp
:calc word(buf,'.',2) <==== get the 2nd word from buf with "." as delim
iii
:calc word(buf,'/') <==== now "/" is the word delim
ftp.iii.net
:calc word(buf,'/',-1) <==== get last word in buf with "/" as delim
tbs
Hope this helps,
Jeff Vance
--
|
|
|