ahh...i couldn't help myself. had to find a fix so i did the following. i
"hard-coded" the 7th word by replacing it with ***** - that assumes that
you won't have five *'s in a row in any of your strings - and then i
located those stars to get the position to start removing from.

anyway...hope this helps. if anyone knows of a cleaner way to do this, i'd
love to see it. like i said, i'm not much of a parser. now i really gotta
go! :) -emily ps...the code is really only 4 lines long but i did a lot of
cfoutputs so you could see the variables being created at each step.

**************

<CFSET var="a long string of text from which i want to get six words.">
<!--- get the length of the string --->
<CFSET VarLen=Len(var)>
<CFOUTPUT>
len of var: #varlen#
</CFOUTPUT>
<BR><BR>

<!--- GetToken() finds the 7th word and ReplaceNoCase() replaces it with
***** --->
<CFSET ReplaceWithStars=ReplaceNoCase(var, GetToken(var,7," "), "*****")>
<CFOUTPUT>
replace with stars (using a space as the word delimeter): #ReplaceWithStars#
</CFOUTPUT>
<BR><BR>

<!--- FindNoCase() finds the position of the stars - you must subtract 1 to
get rid of the space after the 6th word --->
<CFSET Var6WordsPosition=FindNoCase("*****", ReplaceWithStars)-1>
<CFOUTPUT>
position after 6th word: #Var6WordsPosition#
</CFOUTPUT>
<BR><BR>

<CFSET var6Words=RemoveChars(var, Var6WordsPosition, VarLen)>

<CFOUTPUT>
the six words: "#var6words#"
</CFOUTPUT>

********************

At 04:43 PM 4/10/2000 -0600, you wrote:
>ok, this is my quick hack to your problem. i already know that there is a
>problem with it...if the word in the 6th position also occurs in an earlier
>position, then your results are based on that one instead of the right one.
>i don't have time right now to fix this, but felt compelled to give you
>SOMETHING since i gave you the wrong info earlier when i read your e-mail
>too quickly. i'm not great at parsing, so i'm sure someone else can give
>you a better workaround. if they don't, i'll fix this later tonight when i
>have more time. -emily

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to