Re: write on line number two (2) of the file

"brucexs-/[email protected] [power-pro]" <[email protected]> 18 Mar 2019 08:56:49 +0000
Newsgroups gmane.comp.windows.power-pro
Message-ID <[email protected]>
On method 2:  I am pretty sure you cannot update a file in place.  That is, you cannot just replace the 2nd line of a file and leave the rest of the file unchanged. 

 Instead, you have to create a new file, then use file.readline on the first file and file.writeline to copy to new file, but changing the 2nd line as part of that copying.  Then you can rename the files to eg add."backup" or similar to first file name and then rename 2nd to first original name.
 

 And just to be explicit:  Take backups of any files before experimenting!