I need to be able to read, write, and change lines of data saved in a file.

The data would be indexed with a unique number.

Example of what I will have:

1234,name,address,phone number

How can I do this?