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"