Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Sorting text based on line prefix (http://www.go4expert.com/forums/sorting-text-based-line-prefix-t1814/)

jamieplucinski 5Nov2006 08:43

Sorting text based on line prefix
 
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

shabbir 6Nov2006 10:50

Re: Sorting text based on line prefix
 
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??

jamieplucinski 6Nov2006 10:55

Re: Sorting text based on line prefix
 
Quote:

Originally Posted by shabbir
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??

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

shabbir 6Nov2006 11:28

Re: Sorting text based on line prefix
 
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.


All times are GMT +5.5. The time now is 08:31.