And what is the best method of reading .dat files and having my code understand which portions to change if wrong and which ones to record?
That requires you to know the format of the file. The '.dat' file extension is just a generic notation for files containing data - there isn't any implied structure to the data.
To do anything useful with the data, you have to know how it is formatted. Either by reading a format specification provided by the author of the software which created that file, or by opening up the file in a text/hex editor, and reverse-engineering the structure.
If you open up the file in Notepad and you find you can read the contents easily, then it is a plain-text format, and will be fairly easy to interpret. If you open it in Notepad and it is just gibberish, then it is a binary format, and reverse engineering will be a painstaking process conducted with a hex editor, and healthy supply of caffeinated beverages.
If you are able to upload a sample of such a file, one of us can take a look and tell you if this is feasible.