Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fix fields with binary data
Message
 
 
À
14/02/2002 10:52:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00620059
Message ID:
00620076
Vues:
27
>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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform