Python Forum
update txt file but keep a specific line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
update txt file but keep a specific line
#3
Hi Gribouillis,

You are probably not wrong, I think I don't fully understand the write command.

I thought that:
if source file has 20 lines
and
target file has 30 lines
only 20 lines were overwritten by the source file.

But I ran a test and that didn't happen. The target file ended with 20 lines.

So I guess I have some catching up to do on that topic.
Reply


Messages In This Thread
RE: update txt file but keep a specific line - by 3Pinter - Dec-16-2019, 07:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting specific file from an archive tester_V 4 552 Jan-29-2024, 06:41 PM
Last Post: tester_V
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,655 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Getting last line of each line occurrence in a file tester_V 1 889 Jan-31-2023, 09:29 PM
Last Post: deanhystad
  How to read csv file update matplotlib column chart regularly SamLiu 2 1,087 Jan-21-2023, 11:33 PM
Last Post: SamLiu
  Reading Specific Rows In a CSV File finndude 3 1,013 Dec-13-2022, 03:19 PM
Last Post: finndude
  Writing string to file results in one character per line RB76SFJPsJJDu3bMnwYM 4 1,410 Sep-27-2022, 01:38 PM
Last Post: buran
  How to extract specific data from .SRC (note pad file) Shinny_Shin 2 1,292 Jul-27-2022, 12:31 PM
Last Post: Larz60+
  Is it possible to update a CSS file from Python bigAL_python 4 2,324 Apr-20-2022, 01:38 PM
Last Post: bigAL_python
  Print to a New Line when Appending File DaveG 0 1,238 Mar-30-2022, 04:14 AM
Last Post: DaveG
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,099 Mar-28-2022, 03:38 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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