Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to parse numbers only from a string?
Message
 
 
À
02/12/2002 21:25:06
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00728861
Message ID:
00728868
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
Hi Henry,

There were few threads recently on the same topic. Anyway, you need CHRTRAN function, e.g.
phone = chrtran(OldPhone,"()- ","")
or
lcDigits = "1234567890"
phone = chrtran(OldPhone,chrtran(OldPhone, m.lcDigits,""),"")
>Hi all:
>
>I currently have an Excel spreadsheet with data from an MDB file, which I plan to insert into a new VFP free table.
>
>
USE Details
>ZAP
>APPEND FROM c:\Delta\Clients TYPE xls
>
>The above code works. I proceed to select information from Details.dbf into a cursor and then assign some variables their values from the fields in the cursor.
>
>Problem: There is one field which contains the phone numbers along with their area codes, formatting and sometimes it even contains text e.g.
>
>
MESS:(999) 999-9999
>
>How do I parse the numbers only i.e. only the 9999999999, so that I can assign this vlaue to a variable which will then be inserted into the main client table.
>
>Thank you for your guidance.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform