Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching not the same words
Message
From
14/02/2005 10:10:54
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
14/02/2005 09:49:28
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00986592
Message ID:
00986635
Views:
19
I did some programming, since I find this an interesting problem.

Words.dbf contains a memo field, "words", with the words which may have repetitions.

The result is copied into a table "Words2".

In the resulting tables, the words are sorted alphabetically; this is more or less automatic, because of the SELECT...DISTINCT. (On the other hand, since I didn't explicitly sort, there is no guarantee that the result will always sort correctly.)
close database all
erase words2.dbf
create table words2 (words M)
use words in 0
select words
scan
	m.words = words
	m.words = strtran(words, " ", chr(13) + chr(10))
	* Repeat above for commas and other separators
	alines(awords, m.words)
	dimension awords(alen(awords), 1)
	create cursor temp (word C(100))
	append from array awords fields word
	select distinct word from temp into cursor temp
	select words2
	append blank
	for i = 1 to reccount("temp")
		goto (i) in temp
		replace words with alltrim(temp.word) + space(1) additive
	next
	replace words with alltrim(words)
endscan
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform