The information in this article applies to:
SUMMARYThe procedure below describes how to parse the contents of one field into two or three separate fields. For demonstration purposes, the CONTACT field in the TUTORIAL\CUSTOMER.DBF database, which contains 500 records, is used as an example. The CONTACT field contains both the first and last names of the contact person. MORE INFORMATIONIMPORTANT: Prior to issuing commands that will alter the structure of the original database, we recommend that a second or backup copy of the database be created. For this example, use the following commands. (Note that this sample subdirectory structure is a generic one that may not match the one installed on your computer.)
Parsing Data in the CONTACT FieldTo parse the data in the CONTACT field, do the following:
Parsing One Field Into Two FieldsTo parse the CONTACT field from all the records in the database into the corresponding record's FIRST and LAST fields, issue the following commands with the scope of ALL included:
Parsing One Field Into Three FieldsTo parse one field with the following format "Lname, Fname Mname" into three fields, use the following code sample. The REPLACE command could also be used in the following example.
REFERENCESFor more information about the ALLTRIM(), AT(), ATC(), RAT(), and SUBSTR() functions, see the FoxPro version 1.02 and version 2.0 "Commands & Functions" manuals and the FoxPro 2.5 "Language Reference" manual. © Microsoft Corporation 1977, All Rights Reserved. Additional query words: VFoxWin FoxDos FoxWin 2.50 2.50a 2.50b
Keywords : kbcode FxprgGeneral |
Last Reviewed: August 24, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |