Gordon Waters wrote: > Hi Delphi Fans, > > I am trying to format a series of text files and combined them in to one > large file. > > My issue is that my input text files are generated by an external > system, and this is putting 4 blank lines through out the text file, > what I am trying to do is to remove these 4 blank lines.(and only the 4 > blank lines) from the files. > > I am currently reading the input files from disk, and appending them to > a memo, I then save this memo back to disk with a new name. > > So what I am asking is what is a easy way to detect 4 x CR LF in a row > and skip appending these to my memo.
You could load the entire file into a string and then scan it for the 4 CRLF sequences in a row. I'd suggest using something other than Delphi's built-in Pos() routine though; it's dreadfully slow for this kind of thing. There's lots of Pascal/Delphi implementations of good string searches (e.g. Boyer-Moore) available on the Net. HTH Stephen Posey [EMAIL PROTECTED] _______________________________________________ Delphi mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi

