How to read different parts of a text file

I can read and write to a text file but right now I can just do one number, that I uses to count how many levels the player has finished. Right now if the player bets a level and goes back to the hub level and plays the same level again they still get progress.

So I want to store Booleans for if the player has beaten a current level like

UndergroundLevel = 0

SkyLevel = 1

I need a way to save this and find it again. I need to find “SkyLevel” then only take the “1” to do the check or set it.

.

Here is the code I’m using to add to the number of levels completed

FString FileNameA = “level.txt”;

FString SaveTextA;

FFileHelper::LoadFileToString(SaveTextA, *(FPaths::GameDir() + FileNameA));

.

float adding = FCString::Atof(*SaveTextA);

adding += 1.0f;

FString SaveTextB = FString::SanitizeFloat(adding);

FString FileNameB = “level.txt”;

FFileHelper::SaveStringToFile(SaveTextB, *(FPaths::GameDir() + FileNameB));