From: jrubenki@SPAM-B-GONE@mother.com (Neil J. Rubenking) Newsgroups: borland.public.delphi.objectpascal Subject: Re: How do I delete a line in a textfile? Date: Thu, 7 Jun 2001 05:52:33 -0700 Message-ID: References: <3b1f6f70_1@dnews> Organization: Rubenking Interplanetary X-Newsreader: MicroPlanet Gravity v2.10.940 NNTP-Posting-Host: 63.150.8.196 X-Trace: dnews 991918332 63.150.8.196 (7 Jun 2001 05:52:12 -0700) Lines: 15 Path: dnews Xref: dnews borland.public.delphi.objectpascal:191713 In article <3b1f6f70_1@dnews>, nospamps@paxit.dk says... > How do I delete the first line or the first 10 lines > in a textfile. I am running a logfile on an application, > and I want to keep the size of the logfile down. If the file is small enough, create a TStringList, do LoadFromFile(), delete the unwanted lines, do SaveToFile(). If the file size is huge, you have to copy it to a new file, omitting the lines you don't want. -- Neil J. Rubenking Contributing Technical Editor PC Magazine