Populate Structure with SD Card Information

I am working on creating an RFID scan system that logs every time a truck leaves a job site. Right now I have my code fully functional and implemented at the job site, but looking to streamline defining of some RFID hex values to populate some Structures for truck type, and truck and pup numbers.

At this point I have this hard coded in the programmed code, but trying to make this a little more user friendly for future uses.

What I am looking to do, is build/populate the structures from CSV files that can be loaded on to the SD card and update the structures each time the arduino is booted up. With the known HEX value of each scan tag, I am trying to populate the below referenced structures.

My full code is attached due to size. The 3 structures I am trying to populate are “struct TRUCK”, “struct PUP” and “struct TYPE”, which are shown below. I am sure once I have one figured out, it should be fairly straight forward to program the rest, but I am just getting in to using SD cards with arduino and reading/writing from/to the card, so a little guidance would be great!

Thanks in advance for any pointers! And I apologize for the long code, but wanted to include the full functioning code for reference on where these structures come in to play.

//Truck Numbers and tag ID
struct TRUCK
{
  unsigned long TruckID;
  const char *truckname;
} Trucks[] =
{
  {0x324D19A6, "7100"},
  {0xC24E52A6, "7101"},
  {0x5229B3A5, "7102"},
  {0x22A1AFA5, "7103"},
  {0x5239A7A5, "7104"},
  {0xFCE3B0FE, "7105"},
  {0x9CE60F75, "7107"},
  {0xE3EDF61, "7109"},
  {0x9E35E761, "7111"},
  {0xEE63E261, "7113"},
  {0x55987253, "7115"},
  {0x15D16B53, "7116"},
  {0x35588153, "7117"},
  {0x875E8B64, "7118"},
  {0x35CC6953, "7119"},
  {0x8B23D9A1, "7120"},
  {0x2B68C2A1, "7122"},
  {0xB49CFA1, "7124"},
  {0xCB75DFA1, "7126"},
  {0x4BA0CFA1, "7128"},
  {0x89A6CD14, "7130"},
  {0xE962CD14, "7131"},
  {0xE9ED5200, "7132"},
  {0xD97D6B00, "7133"},
  {0xA9C01200, "7134"},
};
const byte TruckCount = sizeof Trucks / sizeof Trucks[0];

char* trucknametocard = "";


struct PUP
{
  unsigned long PupID;
  const char *pupname;
} Pups[] =
{
  {0xFCE3B0FE, "7106"},
  {0x9CE60F75, "7108"},
  {0xE3EDF61, "7110"},
  {0x9E35E761, "7112"},
  {0xEE63E261, "7114"},
  {0x8B23D9A1, "7121"},
  {0x2B68C2A1, "7123"},
  {0xB49CFA1, "7125"},
  {0xCB75DFA1, "7127"},
  {0x4BA0CFA1, "7129"},
};
const byte PupCount = sizeof Pups / sizeof Pups[0];

char* pupnametocard = "";


struct TYPE
{
  unsigned long TypeID;
  const char *trucktype;
} Types[] =
{
  {0x324D19A6, "Single Side"},
  {0xC24E52A6, "Single Side"},
  {0x5229B3A5, "Single Side"},
  {0x22A1AFA5, "Single Side"},
  {0x5239A7A5, "Single Side"},
  {0xFCE3B0FE, "Double Side"},
  {0x9CE60F75, "Double Side"},
  {0xE3EDF61, "Double Side"},
  {0x9E35E761, "Double Side"},
  {0xEE63E261, "Double Side"},
  {0x55987253, "Single Belly"},
  {0x15D16B53, "Single Belly"},
  {0x35588153, "Single Belly"},
  {0x875E8B64, "Single Belly"},
  {0x35CC6953, "Single Belly"},
  {0x8B23D9A1, "Double Belly"},
  {0x2B68C2A1, "Double Belly"},
  {0xB49CFA1, "Double Belly"},
  {0xCB75DFA1, "Double Belly"},
  {0x4BA0CFA1, "Double Belly"},
  {0x89A6CD14, "Oversize Side"},
  {0xE962CD14, "Oversize Side"},
  {0xE9ED5200, "Oversize Side"},
  {0xD97D6B00, "Oversize Side"},
  {0xA9C01200, "Oversize Side"},
};

TruckTracker.ino (21 KB)