Python Forum
Replace lines from one .txt file to another
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Replace lines from one .txt file to another
#10
(Jun-23-2017, 06:36 AM)Tumppi Wrote: It work if i write "linestocopy=[1,2,3,4,5,6,7,8........]" but i think here is easier way?

Instead of writing all the numbers separately, you can write range(65) and python will fill it our for you
Reply


Messages In This Thread
RE: Replace lines from one .txt file to another - by Kebap - Jun-23-2017, 07:24 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replace a text/word in docx file using Python Devan 4 4,085 Oct-17-2023, 06:03 PM
Last Post: Devan
  Need to replace a string with a file (HTML file) tester_V 1 853 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Replace columns indexes reading a XSLX file Larry1888 2 1,053 Nov-18-2022, 10:16 PM
Last Post: Pedroski55
  Delete multiple lines from txt file Lky 6 2,426 Jul-10-2022, 12:09 PM
Last Post: jefsummers
  How to do a mass replace within a CSV file? cubangt 9 5,643 May-09-2022, 06:52 PM
Last Post: snippsat
  I get an FileNotFouerror while try to open(file,"rt"). My goal is to replace str decoded 1 1,470 May-06-2022, 01:44 PM
Last Post: Larz60+
  failing to print not matched lines from second file tester_V 14 6,352 Apr-05-2022, 11:56 AM
Last Post: codinglearner
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,207 Mar-28-2022, 03:38 PM
Last Post: snippsat
  Importing a function from another file runs the old lines also dedesssse 6 2,694 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  [Solved] Trying to read specific lines from a file Laplace12 7 3,675 Jun-21-2021, 11:15 AM
Last Post: Laplace12

Forum Jump:

User Panel Messages

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