Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp50 - import from a text file into vfp
Message
From
09/07/1997 15:26:01
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
08/07/1997 08:39:54
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00038828
Message ID:
00039153
Views:
45
> are you using APPEND > FROM to post to the vfp dbf file? I want to move a text file (using a low > level file > functions) to a vfp dbf file. Could you show me some code?..thanks > again..rob Using Append From is much, much faster, only if it's possible :) That is if the text file is falling into some of available formats (SDF, tab delimited, comma delimited, anything delimited). Doing it with LL functions is a bit of a PITA but is mostly unavoidable if you have to deal with foreign data formats. I used that approach for converting MBP (and other) Cobol data, even when the original table was fixed-length and cr-ended (that is, SDF) because some of the fields contained null bytes, in which case the columns to the right were read as blanks, no matter if only one was blank. The general approach is to read a portion of a source file into a string buffer (recognizing the EOL is a story for itself, and won't work if the line contains nulls), then chopping the string into substrings, converting the cutouts to proper data types (like converting as mmddyy string into a date variable, or storing a val(chop)/100 into a m.numeric_var), and then Insert Into DestTable From Memvar, and so on While Not Feof(source_handle), and =fclose(source_handle) after that. The best part of the story depends on the data you are reading - what were they written with, what's the format, what's the delimiters and so on. It may be a good experience to do it once in a while, but I strongly recommend to Append From, if possible.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform