Page 1 of 1

Reading in a text file paragraph by paragraph

Posted: Mon Mar 06, 2006 11:15 pm
by Hanno
Hi,

I am reading in a text file that has tabs. I want to process each paragraph, i.e. line by line. Once I have loaded the text file into the TRichViewEdit, how to I retrieve each whole paragraph to a string, line by line? For example,
for i := 0 to number of paragraphs do begin
st := paragraph;
//do some processing on string.
end;

Posted: Tue Mar 07, 2006 5:55 pm
by Sergey Tkachenko
May be you can save the whole text in one string, then read substrings between CR+LF characters?
You can use functions from RVGetText.pas or RVLinear.pas

Posted: Wed Mar 08, 2006 2:19 pm
by Hanno
OK thanks. I used a TStringList and loaded everything in there instead. Thanks.