Read in the whole life, change the line in memory, write out the whole file. You can't really change one single line unless the new line is the exact same length, or you use a special file format like a database that has fields and padding and stuff.