You can read in the text to an input buffer (tstringlist or memo)
and append the wanted lines to an output buffer:
//Pseudocode:
4counter = 0;
marker = 0
Repeat
begin
line := buffer[marker];
if line <> ''
then
begin
//Copy 1, 2 or 3 empty lines to outputbuffer, but not 4
if 4counter > 0 buffer.add('');
if 4counter > 1 buffer.add('');
if 4counter > 2 buffer.add('');
buffer.add(line);
4counter = 0;//reset to zero empty lines
end
else
inc(4counter);
if counter = 4
then
begin //drop the current 4 empty rows
4counter = 0; //start counting the next 4 rows
end;
inc(marker);
until
marker > buffer.count;
>
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi