Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import wizard
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00388604
Message ID:
00388670
Vues:
8
>I need to build an "import data file" option to my name/address table. I don't have control of the field layout of the incomming txt file. Wondering if there are any prebuilt "text file parser/field mapper" widgets like what excel has.
>
>Desc of app: http://fox.wikis.com/wc.dll?wiki~ConferCarl~VFP

Carl, I've had considerable success using a third-party product called Data Junction; it's probably overkill for this application.

I'd consider writing something based on having the user provide a record on-screen, and then assign record segments to existing fields. You could then construct an appropriate intermediate cursor with field names matching the real names in your name/address table, and synthesizing garbage names to absorb fields that have no direct correspondence. Once this cursor is created, you would use it to do an APPEND FROM source file TYPE whatever, and then APPEND that file to your name/address file; VFP will match fields by field name, so order, excess fields or missing fields would not be an issue.

Depending on the nature of the input file, you may need a more robust parser than APPEND FROM; you can create a much stronger parser using the VBScript.RegExp regular expression COM object.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform