This chapter presents different ways for using text files in games to represent and communicate data. Creating, reading, and writing to text files can be performed in many ways, and apart from generic plain text files, there are the common data interchange text file formats of JSON and XML. This chapter presents a range of recipes for creating, reading, and writing to text files with different types of text content. These are useful for games that save data locally to the device they are running on, and also when communicating with online clients.
You can read the chapter here: https://www.packtpub.com/sites/default/files/downloads/WorkingwithPlainTextXMLandJSONTextFiles.pdf