Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading Large Text Files
Message
From
19/07/1999 18:42:34
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
19/07/1999 08:42:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00243031
Message ID:
00243338
Views:
22
>Greetings,
>
>I have an app which needs to read several *.txt files. I open each of the files using fopen() and read what I need. Everything works great and quick except for 1 file. This is a very large file (4 MB) and each line is also longer than 255. What I did was create a table with a memo field, append the text field into the memo field then read the memo field line by line using mline(). This however takes a very long time to read. Short of creating a table with all the fields for the text file, is there a way I can open this file and read it much quicker.
>
>Thanks in advance,
>
>Scott

There's a neat trick about using mline() - check the third parameter and the _mline memory variable in Help. In brief,

for i=1 to memlines(theMemo)
=mline(theMemo,i)
endfor

is several times slower for large memos and/or strings than

_mline=0
do while _mline =mline(theMemo, 1, _mline)
endd

I remember I found it in Help, back then in 2.0 or earlier.

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