Best way to manage stats in a text file

I’m thinking of reading user stats from a text file, line at a time. My questions:

1.) Saving data line-by-line. I can get the string, how do I just add a line?
2.) What do you say is the best (most efficient way) to save the user’s stats (weapons, points) I’m thinking of this:

If my text file looks like this:



The username and password are separated with String.Split(";");

It’s also separated by the slashes and decimals, so they’re all separate.

My idea is that every separated blank represents the weapon that they have per class (like 2 is sub-machine 2, etc). Then the /28450 is their points (except for the slash) and the other is their level. Maybe even upgrades/perks/etc should be included. What do you think? Remember it’s going to be a string so it needs to be able to read it as text. You have a better and more efficient way?

Use PlayerPrefs.

Create a class called playerstats and then save all the data in that class, then save all the classes in a list and then serialize that list. I use this method to serialize my data.