Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing unprintable characters in character and memo f
Message
 
 
À
06/12/2004 12:08:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00967248
Message ID:
00967271
Vues:
8
>I need to remove unprintable characters from existing tables. My approch is to
>
>1. use AFIELDS function to find character and memo fields in a table
>2. For character field SCAN the table for each character field
> a. use CHRTRAN functuin to eliminate unprintable characters
> b. find lenght of new and old strings
> i. if lengths are diffrent replace old value with new one
>
>My Questions
>
>A. Is there a more efficent method of doining this?
>B. How can I remove multiple spaces so that there is only 1 space between text?

Use reduce function from foxtools.fll


>C. Will this work for memo fields?
>
>Eventual goal is to a form where user picks the table to be fixed so that paths will be set. For testing I am writing this as a program.

I think your plan is efficient enough. Mark is right that you can write an UDF and do replace all, but this may be slow and cause some undesired effects if you have some rules updating timestamps when record changes. I would probably do a scan loop instead and use some progress bar...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform