Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help me please...
Message
From
31/12/1998 11:45:34
 
 
To
29/12/1998 14:33:47
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00171168
Message ID:
00171917
Views:
35
>>First, I agree with you that there are times when low-level file I/O makes sense. I said I know of one situation where it probably makes sense. Many people have probably seen situations where it makes sense, that I haven't seen.
>>
>>But I have used append from even when there's a "header record" and/or "trailer record" in the text file. (Pause to let you laugh.) You just make the field layout of the file you're appending into more flexible, (a few long text fields) rather than reflecting the real field layout. You take the first and/or last records and parse out the header/trailer information and put it where it goes, and delete them (or use scan-for in the next part to ignore them). Then scan the dbf to parse the "real" records into another dbf.
>
>Faster than that - create sufficient number of tables (one per record layout), and append into each one of them, providing some FOR clause to filter out the records which don't belong to this table. Like,
>
>select first
>append from the.txt sdf for isdig(field44) && this type of record always has some digits there, others don't
>select second
>append from the.txt sdf for not empty(datefield) && if this is not a valid date, it's not a record of type 2
>...etc
>
>Of course, the conditions (and mileage) will vary, depending on record structures in each individual case, but at least you don't have to do any record chopping or create intermediate tables.


Cute, very cute.... Elegant even.

IMNSHO the best use of low level I/O is when you know that the data you are importing is liable to be contaminated with garbage and spurious characters. I have a file that is sent to me on occasion which has some garbage records that the end user does not see fit to clean out. Mostly they send me updates which are clean and get APPENDed FROM. When they send a complete file dump it goes through my special low level cleaner program first.

Oh well back to examining 3rd party export files which (surprise!!) are not Y2K compliant even though this is a new system for implementation next year......

Jen
A bipolar theory does not neatly describe a continuum.

Before millenium: chop wood, draw water. After millenium: chop wood, draw water.
Previous
Reply
Map
View

Click here to load this message in the networking platform