Microsoft
Software
Hardware
Network
Question : Parsing large files cause an exception
Hi,
I've to parse some very large files (up to 100MB)which cause an out of memory exception.
The way I try it now is this:
FileStream fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read,
FileShare.ReadWrite);
StreamReader sr = new StreamReader(fs);
string strResult = sr.ReadToEnd();
sr.Close();
fs.Close();
I think it will be possible to read them by line but I think for a fast parsing it will be usefull to work with them in memory.
So maybe there's an other way to work with such large files that doesn't cause an exception?
What whould you suggest?
Thanks
Andre
Answer : Parsing large files cause an exception
You can try reading chunk by chunk add them to a stringbuilder as shown in this link =>
http://stackoverflow.com/q
uestions/2
161895/rea
ding-large
-
text-file
s-with-str
eams-in-c
Random Solutions
run excel and run the enable auto refresh
Ho to resole credential issues on Network Load Balancing
sbs 2008 backup configuration
How can I shrink a LDF file of 54GB?
windows 7 home password policy
Setting Up Raid On Windows 2003 Server With Faulty Hard Drive
A non-SYN packet was dropped because it was sent by a source that does not have an established connection with the Forefront TMG computer
Master Page Layout problem
How to separate multiple email accounts into different data files in Outlook 2010
VBscript Help for a Newbie trying to pull AD Computer Info into Excel 2007