Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I do it this way, is there anything faster?
Message
From
22/12/2000 15:56:47
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00455473
Message ID:
00456467
Views:
64
>>I'm not sure how you would do this except with low-level file access. In this situation, there is nothing to APPEND into. Maybe I'll try converting my FoxPro code into C sometime and make a DLL out of it to see if that would be any faster.
>>
>Johathan,
>
>I can prepare a Header (string), I can strtran each line of text (if number of records less than 65000, I can use alines() for this)), also strtofile, filetostr. This is just an idea...

Either way, there is some low level file i/o to be done. The current approach stull operates at the record level; I wouldn't expect any significant speed gain as long as we stay at this level. What I was originally proposing was:
a) create the header as a string
b) measure the .txt file as it is, and assume it has total_length/(record_length+2) records
c) create the .dbf file containing the header with the assumed length already updated in it
d) append the whole .txt file, ignoring the crlfs.

To do this, we need to add a filler field to the original table structure, so the CRs will actually be the content of this field, and we need to assume that LFs will behave fine as delete marks. Even if they don't, we can always wrap the use of this table with "Set deleted off" thus ignoring this mark.

The gain would be that at no point we ever get down to the record level, we operate with the mockup header and the whole file at once. This still needs to create a completely new copy of the file (when adding the header), but it doesn't involve any buffering etc, and can probably be done in one bulk copy.

back to same old

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

Click here to load this message in the networking platform