-
1 Attachment(s)
Playing with text
Hello,
I am a new user, Not just to .net but to development all
together. I appriciate everyones patience eith my very
beginer questions. I need to manipulate large (10m) text
files. I have written some code to do this useing
streamreader to load file contents into a listbox then
manipulateing the text with the stringBuilder class. This
is veeeery slow. reading and manipating takes way to long.
Am I going about this all wrong?
Thanks,
Dale
-
Well I suspect you would get slow speeds with text files that large no matter what but it also depends on whether you are using readtoend or readline?
I'm not sure which would perform better so experiment.
-
Looks as if you're doing the text manipulation *after* the text has been stuffed into a listbox? Seems to me you would want to do any kind of search/replace before you put the results into a line-by-line type control so as to avoid the overhead of picking through the control.
And do I understand you correctly, you're putting 10mb of text into a single listbox?? I don't know if that's very wise in terms of speed...
-
Thanks,
I used readtoend to a string, then manipulated string with stringbuilder, then set textbox = to string
A combination of everyones advise worked great!!!