Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fix fields with binary data
Message
 
 
To
14/02/2002 10:52:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00620059
Message ID:
00620076
Views:
26
>While working with user I noticed that some fields (which were imported for an old system a long time ago) have binary data in them. These fields should have only alphanumeric data in them (a-z,A-Z,0-9), they are names, address, etc.
>
>Question is there a programatic way of safely fixing these fields? Too many values to do manually.

Try this ( not fully tested)
lcDigits = "0123456789"
lcLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lcAllowedChar = lcDigits + lcLetters + Lower(lcLetters ) + Space(1)

Select mytable
SCAN
	IF NOT Empty(Chrtran( myfield, lcAllowedChar, ""))
		REPLACE myfield WITH Chrtran( myfield, ;
					Chrtran( myfield, lcAllowedChar, ""), "")
	ENDIF
ENDSCAN
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform