Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7665011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:27:05+00:00 2026-05-31T14:27:05+00:00

QUESTION: HOW OVERWRITE A LINE IN A FILE AFTER READING THE LINE? By NOT

  • 0

QUESTION: HOW OVERWRITE A LINE IN A FILE AFTER READING THE LINE?

By NOT making a new file, or reading the hole file, since the file has 123.500 lines.

for line in source:

    newline = "+" + line

    #write over the line in the file with newline

line = “HAHA”,
newline = “+HAHA”

How can i replace the newline with the line, in the file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:27:07+00:00Added an answer on May 31, 2026 at 2:27 pm

    Either

    • write to a different file, line by line, or
    • read the whole file in memory and replace the original with a new file you write.

    The fileinput module can assist you with this, as demonstrated in this answer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question Can I build a image database/library that has an e-commerce style checkout system
I want to read a file line by line and capture one particular line
I have following question. I'd like to place a file named data.xml into sdcard/appname
Possible Duplicate: Android How to draw a smooth line following your finger I'm new
Original Question I want to be able to generate a new (fully valid) MP3
Until yesterday my project has only a branch with a .gitignore file similar to:
There are several libraries like ncurses that assist in making command-line GUIs. Simply put,
once again I've got a question. Since I am using Google Web Toolkit (GWT)
The basic question is: How do I perform a basic override of a plugin
I know this question was asked previously and the reply was to override onPrepareContextMenu()/onCreateContextMenu().

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.