Reading and Appending to text file

Hello! I’ve investigated a lot concerning the use of text files in unreal with people mentioning not to use the standard c++ methods of file io. Its common for people to point to FFileHelper and IFileHandle, but neither of those seem to have an easy way of reading a file line by line to find specific data.

Any guidance would be appreciated!

Thanks for the quick response! I was going to actually use the ParseIntoArray as the best bet. I’ll update how that goes when I get the chance to implement it. This is actually for “Achievement” data that reads the achievements from a data table, but keeps time accomplished or ones done on a current run of the game in files. I’m always open to ideas if this method just seems not worth while. Its for a quick summer project, so I thought this would be the fastest way to implement this.

This may be helpful. Here are the [docs][2].

This should give you an array of lines from the file.

TArray lines;
int32 lineCount = FileData.ParseIntoArray(&lines, _T(“\n”), true);

If this is for a configuration file, this and [this][4] may be helpful.

Looking into this more myself, starting dealing with lots of state that became much more complex. Anyways I thought I might add some stuff that I found helpful. For my project I needed configuration files that where not packed with the binaries, something that a user could edit, [this][1] was helpful. I also created a module for [SQLite][2] for saving my more complex data. I’m also using plain text files for saving game state and build info for the build system (saves the number of builds) and it works perfectly fine. I wouldn’t use SQL unless you feel that you really need it, anyways I found a [tutorial][3], but I have no idea if this works (never used any tutorials for this, so cant recommend anything).

[1]:
[2]: SQLite Download Page
[3]: