Did that work when you tried it? Assuming the code to read the file works OK, that code to edit the data looks like it should work.