Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert text file to xml file in VFP6
Message
De
22/12/2005 15:19:05
 
 
À
22/12/2005 14:37:08
Dan Mccoy
Database Applications Development
Lancaster, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01080298
Message ID:
01080320
Vues:
11
Suppose you have a file named data.txt that has data segments. The first data segment is the first name and comprises the first 15 spaces in the file. The 2nd data segment is the last name and comprises the next 15 characters in the file. The third data segment is a note and comprises 40 characters. So the layout would be:
TRACY          HOLZER         THIS IS MY NOTE.
STAR           JONES          STAR's NOTE.
SALLY          SEASHELL       TOO MANY SEASHELLS.
Create a temporary cursor called tfile that matches the layout of the import file:

create cursor tfile (cfield1 c(15), cfield2 c(15), cfield3 c(40))

append from data.txt type sdf

and the data should import into the temporary cursor fine. Then you can step through the temporary cursor and move the data to wherever you need it.


>I need to convert an ansi text file where data segments are determined by position. Does anyone know of VFP code/classes that converts flat files to xml files for import to VFP tables. Thanks...
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform