Results 1 to 4 of 4

Thread: Playing with text

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Fenton,Mo.
    Posts
    15

    Question 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
    Attached Files Attached Files
    Dale

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    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.

  3. #3
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    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...

  4. #4

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    Fenton,Mo.
    Posts
    15

    Thumbs up

    Thanks,
    I used readtoend to a string, then manipulated string with stringbuilder, then set textbox = to string

    A combination of everyones advise worked great!!!
    Dale

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