Solved

How can I delete a line in a text file?

Posted on 1998-02-05
1
145 Views
Last Modified: 2010-04-04
  I can use "Writeln" write a line and use "Readln" read a
line from a text file, but how can I delete a line?

                                    (Thanks a lot)
0
Comment
Question by:thecon
1 Comment
 

Accepted Solution

by:
TechStone earned 50 total points
ID: 1358400
The simple answer is, you can't.  Text files are written from the beginning to the end, and that's it.

In order to delete a line, you must read the file and write all lines but the one you wanted deleted to another file.  I know that sounds like a long way to do things, but that's how text files work.


0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question