are the any specialized techniques for opening 120 MB txt files in VB
when i try, it hangs, or seems to hang.
i can open up a 300 KB file using the same code.
thanx ;P
Printable View
are the any specialized techniques for opening 120 MB txt files in VB
when i try, it hangs, or seems to hang.
i can open up a 300 KB file using the same code.
thanx ;P
Yes, its's called buffering. You can buffer a defined sized block of memory (lets say 1 MB) and parse though your data, when you get close to the end you can buffer in another 1 MB block. This may not work if for some reason you need to entire file in memory (generally, you can make it work)
can you give me some code that puts buffering into use??
tell me one thing :
Does it hange when u open the file or u start reading it...
I think it should not hange when u just open the file...
Make sure that each line has a cr/lf at the end of it. I have the same problems periodically with files I ftp from a server to a pc. If they don't have the proper end of line characters, the program tries to read in the entire file as one line. Then it hangs.
Sometimes re-ftp'ing it and changing the type from binary to ascii (or vice versa) fixes it.
Steve
I donnt think thats a problem.. binary files donnt have new line......
its unclear if it hangs while opening the file or reading from the file......
in my openion it should not hange while opening the file.I have worked in applications(in Unix and in C) where we open files size of GB.