Python Forum
Editing a txt document using python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Editing a txt document using python
#2
Instead of appending, read the file in memory, skip/remove the lines at the top of the file and then add new data. Overwrite the existing file.
This said using sqlite3 database may be more convenient to work with than csv/txt file
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Editing a txt document using python - by buran - Sep-23-2020, 02:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help editing a PDF omar 4 1,166 Oct-22-2022, 08:52 PM
Last Post: Larz60+
  How to get first 5 images form the document using Python BeautifulSoup sarath_unrelax 0 1,687 Dec-19-2019, 07:13 AM
Last Post: sarath_unrelax
  How to extrac a data table from Pdf document using Python Amit0503 1 2,286 May-15-2019, 05:38 AM
Last Post: Larz60+
  [split] Python Guide / Document? kumatul 2 2,804 Jan-16-2019, 12:49 AM
Last Post: micseydel
  Python Guide / Document? Qui_Ten 1 2,877 Jan-13-2019, 07:50 AM
Last Post: Gribouillis
  Can python be used to search a word document for combinations of 6 digits? gkirt1053 2 2,853 Nov-15-2018, 06:22 PM
Last Post: gkirt1053
  Text editing with python UK_SPB 1 2,448 Nov-26-2017, 08:31 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020