|
-
Mar 28th, 2013, 10:49 PM
#1
Thread Starter
Lively Member
Parsing large textfiles?
Hello, I'm trying to do something very basic, though the fact that the text file I'm using is around 152mb in size makes it a bit harder.
I'm trying to parse out HTML tags from the file. My Regex matching function tells me there are around 1100 HTML tags to take out (which isn't that many considering how big the file is), and the parsing function itself is multithreaded, though the program still freezes. I've even tried to compile it under x64, with no luck.
So, how can I effectively parse huge files like that without having my program freeze and not work? The problem is not with my threading or my parsing, it's with the size of the file.
-
Mar 28th, 2013, 11:04 PM
#2
Frenzied Member
Re: Parsing large textfiles?
How are you parsing the file?
-
Mar 28th, 2013, 11:05 PM
#3
Thread Starter
Lively Member
Re: Parsing large textfiles?
 Originally Posted by billboy
How are you parsing the file?
Before I was just opening the file into a string then parsing the string and outputting it again. After some research I figured that I should try the same thing but line-by-line instead. It went a lot faster and didn't freeze, just trying to see if it worked properly or not.
-
Mar 28th, 2013, 11:10 PM
#4
Frenzied Member
Re: Parsing large textfiles?
Use stream reader, line by line should not freeze
-
Mar 28th, 2013, 11:16 PM
#5
Re: Parsing large textfiles?
This works for me, and I am reading text files that are hundreds of megabytes too.
vb.net Code:
Dim myFileReader As New StreamReader(ReadFilePath)
Dim myLine As String = ""
myLine = myFileReader.ReadLine()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|