Is there a way to reference one variable with another? Preferably by name.

An easier solution maybe:

char strFromFile[] = "     - Battery Status -\nVoltage:          %sV\nTemperature:  %sC"; //normally in your file...

char dest[128];
sprintf( dest, strFromFile, BatVolts, BatTemp );
...

Or if you really want to replace the [keywords], you could make a strreplace function (many examples on google) and then use it like:

strreplace( strFromFile, "[BatVolts]", BatVolts);
...

Or even

#define ReplaceKeyword(keyword) strreplace(strFromFile, "["#keyword"]", keyword)

ReplaceKeyword( BatVolts );
...

Just giving ideas out of my head, I don't know if it will help :slight_smile: