Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text Files
Message
De
12/10/2000 15:55:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/10/2000 15:49:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00422628
Message ID:
00428737
Vues:
9
>>Amanda,
>>With regard to large files - low level file I/O using FOPEN(), FGETS(), etc. is actually faster where you only want a subset of the text file being processed. The smaller the subset the bigger the perfornamnce gain (when compared with CREATEing a structure and APPENDing).
>>
>>However once you get past using about 50% of your data, then there is no (or very little) benefit in using low level file I/O. If all of the data is required (in a large file) then the performance gain swings in favour of APPENDing into a structure. In fact if you APPEND into a structure then you gain by having all of the usual data manipulation techniques that VFP offers - why else would you want to use VFP. Also you cannot BROWSE using low level file I/O, from personal experience I have found that many problems were easily solved because I 'looked' at the data. In addition you do not need to concern yourself with FGETS() work arounds ???
>>
>>One last point - the (probable) reason that Cetin's solution is stopping after the first line is the embedded CHR(0)'s and CHR(255)'s in your source file. I pointed these out to you in a private e-mail, I'm guessing that you either did not get it, or chose to ignore it?
>>
>>And finally it now looks like Cetin is also recommending the approach that I suggested at the very beginning!
>>Houston.
>
>Hi! I did get your e-mail and did use your suggestions. That helped me bring in about 20+ of those files just fine. I'm sorry I didn't get a chance to write back and tell you that.
>
>My new problem comes from......well, I have a text file with 100,000+ lines in it. When I append into a table less than 20,000 lines come in (sometimes only 800 lines come in). I'm not sure why it is cutting off. I was planning on going thru one file line by line to see what is stopping it. But of course, I haven't gotten that far.
>
>Any ideas on that one? In case it's not painfully obvious, I don't work to much with .txt files like this. I usually have tab delimited or something to work with.

Amanda,
SafeGetLine works with huge files and chr(0), chr(255) or EndOfFile (Ctrl+Z) characters doesn't stop it from processing file. A VFP field data in itself actually might contain all these chars and chr(13) as well.
But it threats a 'line' ends with a chr(13)+chr(10) pair (or FEOF()) which is the case with SDF type data. I suspect your text file doesn't end lines with this pair.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform