>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~VFPCarl, 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.