1. You have to open the file and read through it
2. You have to:
2a. Open the file for read
2ba. Either make a line buffer and read all the lines into that, then edit a specific line in the array, then write those lines back into the file, or
2bb. Open the file for read, open a temporary file for write, read the file lines and then write them (after any editing) into the temporary file, delete the original file, copy the temp file into the name of the original file, then delete the temporary file
so basically it's not that easy