HP3000-L Archives

July 1995, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeff Vance <[log in to unmask]>
Reply To:
Jeff Vance <[log in to unmask]>
Date:
Mon, 24 Jul 1995 17:22:57 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
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
 
--

ATOM RSS1 RSS2