Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Appending from text file into a memo field?
Message
 
To
16/07/1998 15:21:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00118266
Message ID:
00118456
Views:
14
>I have a 90 meg ascii file that I need to import into a table so I can use it. If i use the import wizard (in VFP5) it takes the first 52 characters and places them into a character field. I takes the rest (800 characters) and places them into a memo field. This is great but I would like to do it without going through the wizard.
>
>If I create the structure, one character field and one memo field and then APPEND FROM SDF nothing goes into the memo field. If I APPEND MEMO it all goes into a single memo field rather than creating the 200k records. I haven't been able to get INSERT SQL to work either.
>
>What am I doing wrong?
>
>Thanks
-------------------------------
Jim,
I know you'll get the standard answers from most...low level file I/O....

From what little you've said, I believe I have a faster and more flexible and more adaptable way of doing it. The code is back at the office. I'll either send it to you tomorrow (if you email me at Rick@OmniaGroup.com), or I'll post it here.

In a nut shell it goes like this.

You create your ascii file using delimiters for fields and records that do not naturally occur in text...it wouldn't do to delimit with TAB if your memo may contain TABs

You know which field in the ascii file is the memo.

you read in a chunk into memory and set up two sliding windows
the first window hold X records .... just a substring...if it's too large the process slows down.... so X is around 100 roughly...you don't really care...just grab about 1% of you total data to process...don't worry about record boundaries....yet. :-)
The second window glides from memo to memo... substrings the memo out of the first string, into a variable...

Then REPLACE myMemoField WITH cTheMemoString

The skip to the next memo.

IT FLYS!!!

................I should make a utility out of it and post it. :-)
Rick
Previous
Reply
Map
View

Click here to load this message in the networking platform