To add text, you can use either use "fopen", "fputs" and the other file-reading functions or use only the "write_file" function if the other method is too compilcated for you.
For removing text, you can read all of the file's contents and store it into a dynamic array. Make sure NOT to read the line you want to remove. Then simply rewrite the file by looping the array and pushing all of the text inside it.