Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cecil Champenois
  Where is Cecil Champenois?
 Little Elm
 Texas - United States
 Cecil Champenois
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: Discussion on Inconsistent Data
Thread ID: 395339 Message ID: 395384 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, January 14, 2014 3:12:39 PM         
   


> >
> > Try this for start then enhance depending on what it cannot parse.
> >
> >
clear
> > ?parse("MEDICAL + BENEFIT + LIFE")
> > ?parse("MEDICAL + BEN + LIFE")
> > ?parse("MED+ BEN + LIFE")
> > ?parse("MEDICAL + BENEFIT + LIFE + VISION")
> > ?parse("MEDICAL + BENEFIT + LIFE + VISION, DENTAL")
> > PROCEDURE Parse(cString)
> > 	local i,n,delims,out
> > 	delims = "+,"
> > 	out = ""
> > 	n = getwordcount(cString,delims)
> > 	if left(getwordnum(cString,1,delims),3) = "MED" then
> > 		out = "MEDICAL"
> > 		if n > 3 then
> > 			for i=4 to getwordcount(cString,delims)
> > 				out = out+","+getwordnum(cString,i,delims)
> > 			next	
> > 		endif
> > 	else
> > 		out = "Cannot Interpret"
> > 	endif
> > RETURN out

> >
> > Tony
>
>
> That will work only as long as the sequence of the words starts with 'MED'. It will fail when the encoder change the sequence like:
>
>
?parse("BENEFIT + MEDICAL + LIFE + VISION, DENTAL")

>
>
>
>
>
> https://vfpx.codeplex.com/releases/view/99045
> http://sandstorm36.blogspot.com

Although I haven't seen any other sequence than MEDICAL + BENEFIT + LIFE, there is no doubt that I just may see variations in what begins that string.

Cecil Champenois, Jr.

ENTIRE THREAD

Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/13/2014 6:15:46 PM
RE: Discussion on Inconsistent Data Posted by David Mustakim @ 1/13/2014 6:40:05 PM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/13/2014 6:46:51 PM
RE: Discussion on Inconsistent Data Posted by Tony Vignone @ 1/13/2014 6:49:00 PM
RE: Discussion on Inconsistent Data Posted by Jun Tangunan @ 1/14/2014 6:36:47 AM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/14/2014 3:12:39 PM
RE: Discussion on Inconsistent Data Posted by Tony Vignone @ 1/14/2014 6:58:46 PM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/14/2014 7:44:48 PM
RE: Discussion on Inconsistent Data Posted by Tony Vignone @ 1/14/2014 11:12:28 PM
RE: Discussion on Inconsistent Data Posted by Vilhelm-Ion Praisach @ 1/13/2014 7:00:25 PM
RE: Discussion on Inconsistent Data Posted by Tony Vignone @ 1/14/2014 7:00:35 PM
RE: Discussion on Inconsistent Data Posted by Vilhelm-Ion Praisach @ 1/14/2014 7:53:25 PM
RE: Discussion on Inconsistent Data Posted by Tony Vignone @ 1/14/2014 11:08:17 PM
RE: Discussion on Inconsistent Data Posted by Pete Sass @ 1/13/2014 7:55:46 PM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/13/2014 9:09:42 PM
RE: Discussion on Inconsistent Data Posted by David Mustakim @ 1/13/2014 9:24:52 PM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/13/2014 9:49:26 PM
RE: Discussion on Inconsistent Data Posted by Pete Sass @ 1/13/2014 9:41:48 PM
RE: Discussion on Inconsistent Data Posted by Cecil Champenois @ 1/13/2014 9:51:13 PM
RE: Discussion on Inconsistent Data Posted by Michel Levy @ 1/13/2014 10:01:45 PM
RE: Discussion on Inconsistent Data Posted by Vilhelm-Ion Praisach @ 1/14/2014 6:45:45 AM
RE: Discussion on Inconsistent Data Posted by Jun Tangunan @ 1/14/2014 1:15:20 AM
RE: Discussion on Inconsistent Data Posted by Tore Bleken @ 1/14/2014 8:53:53 AM