title: How to read and replace a line in the same file
body: <p>I have a huge text file with multiple rows of lines. I want to read the file sequentially and whenever i locate the string assume "Apple" in any of the lines </p>
  
  <p>I want to replace the entire line and not just the string "Apple". </p>
  
  <p>Note: "Apple" is just a string in the line with multiple other characters.
        Replace the line with "We no more sell apples in this store".</p>
  
  <p>I read that <code>file.readlines()</code> is not efficient if reading huge files. Hence please give me guidance how i can achieve this without using <code>readlines</code>.</p>