One problem you will have, if you try to update files 2, is that you can not write a new, longer line, into the middle of file 2, without overwriting the following data:
# Original file 2:
Bloggs,Fred\n
Conner,Sarah\n
Bloggs,Joe\n
# file 2 after adding Fred's phone Number
Bloggs,Fred,0234687821\n
h\n
Bloggs,Joe\n
As you can see, poor old Sarah Conner, has been terminated. Follow the advice to build a new file, and if required remove (or rename) the old file 2, and rename the new one, to the original name, when done.
Cheers,
R.
Pereant, qui ante nos nostra dixerunt!