Results 1 to 5 of 5

Thread: Proccessing Large Text Files, Please Help

  1. #1
    Guest

    Unhappy

    My problem is that I have a text file thats around 6MB and its going to be getting bigger everyday, its a log file for a web server. I've tried to load it into a vb using the standard Open then line input stuff but vb either runs out of mem or hangs forever. If anyone knows code that will make it load a lot faster please post it or send me and email, ryan0024@hotmail.com. Something like wordpad would work great, because it loads the file in like 5 seconds, any help would be appreciated, thanks.

  2. #2
    Guest
    Why don't you use the RichTextBox control? It can hold up to 2 GB.

    RichTextBox1.LoadFile "C:\myfile.txt", rtfRTF 'or rtfText for regular text files

    RichTextBox1.SaveFile "C:\myfile.txt", rtfRTF 'or rtfText for regular text files


    ..just a suggestion .

  3. #3
    Guest
    is there a way to show the progress of the file being loaded in the rich text box?

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I think you can open the file binary... then get it in chunks and then calculate the loaded part and the filesize to show the progress.
    Use the RichTextBox as Matthew said, but open the file for binary.
    See kedaman's site for more info about Files in VB
    http://www.kedaman.com < hey keda, you gotta pay me for all this advertising!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  5. #5
    Guest
    when I open it as binary almost all the characters turn into ?'s.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width