Sorting text based on line prefix

Discussion in 'C#' started by jamieplucinski, Nov 5, 2006.

  1. jamieplucinski

    jamieplucinski New Member

    Joined:
    Nov 5, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hi everyone. I am currently grabbing a local INI file and removing unneeded entries outside of an area that looks as follows:

    [User patterns]
    ! Comment here
    @@test.com/
    *test.com/*
    #tag(name=id)

    The text above is what I am left with after removing all unneeded entries, but now I need to a way or sorting different data types into different text boxes. Each line prefix specifies a new data type, !, @@, # are all line prefixes, with everything else being another type.

    I need a way of sorting through the text box that currently contains around 60KB of data (and growing) into different text boxes depending on the data type. I have tried everything I can think of, and to no avail; it is however probably me doing something wrong.

    Thanks in advance,
    Jamie Plucinski
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    Sorry but I could not get what you are looking for.

    Is it just you want to check if the textbox you are adding the text to has more than 60 KB of data or what??
     
  3. jamieplucinski

    jamieplucinski New Member

    Joined:
    Nov 5, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Sorry if it wasn't clear; basically what I want to do is sort through a text box that contains upwards of 60KB of data. The text contains many lines, some a prefixed with a character or characters and some are not.

    I need a way or sorting lines that start with @@ into their own text box, lines that start with # also need to go into their own textbox, and any other lines left over need to be put into their own text box.

    Thanks,
    Jamie
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,376
    Likes Received:
    388
    Trophy Points:
    83
    If you are to process large amount of data and which can take long time you have 2 options

    1. Use threads
    2. Use a GUI to indicate some work is done.

    I am sure you need to be parsing those 60 KB of data one line at a time only.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice