Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Obnoxiously large text file
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01290411
Message ID:
01290582
Views:
12
Hi, Larry!
What about using File Scripting object?
Clear
lcFile2Read="name_and_path_your_large_file"
lnFileMode=1 && only for read
llForceCreateNew=.F.
lnFormat=0 && ASCII &&
lcResultString=""
lnHowManyCharactersPerRead = 1

loFSO = CREATEOBJECT('Scripting.FileSystemObject')
If loFSO.FileExists(lcFile2Read)
   loTextStream=loFSO.OpenTextFile(lcFile2Read,lnFileMode,llForceCreateNew,lnFormat)
*!*   loFile=loFSO.OpenTextFile(lcFile2Read,lnFileMode,llForceCreateNew) && valid command
   DO WHILE !loTextStream.AtEndOfStream
      * you can read on the byte by byte basis
      * lcResultString=lcResultString+loTextStream.Read(lnHowManyCharactersPerRead)
      * here may be your code for text psrsing
      
      
      * or you can read on the text line basis
      lcResultString=loTextStream.ReadLine
      ? lcResultString
   ENDDO
   loTextStream.Close
Endif

Release loFSO
Previous
Reply
Map
View

Click here to load this message in the networking platform