c# - Custom JSON similar configuration file

128 Views Asked by At

I am working on a project that I need to read and write to a custom configuration file, from a NAT device, that looks to be very similar to JSON but with some different aspects. I have not been able to come up with a way to read/write to the file besides going through it line by line. I am hoping someone may have a suggestion to how to read/write this configuration.

Below is a template of how the configuration file is laid out.

SYSTEM1 = {
    Parameter1 = "1"
    Parameter2 = "abc"
    Parameter3 = "def"
    Parameter4 = "ghi"
}
SYSTEM2 = {
  MIB2 = {
    MIB2_SYSTEM = {
      sysContact = "Contact String"
      sysName = "Name String"
      sysLocation = "Location String"
    }
    MIB2_IF = {
      MIB2_IFENTRY = {
          {
          INDEX = 1
          Parameter1 = "1"
          Parameter2 = "1"
          Parameter3 = ""
          }
          {
          INDEX = 2
          Parameter1 = "1"
          Parameter2 = "1"
          Parameter3 = ""
          }
      }
    }
    MIB2_MAU = {
      MIB2_IFMAUENTRY = {
          {
          INDEX = 1.1
          Parameter1 = "value"
          Parameter2 = "value"
          }
          {
          INDEX = 2.1
          Parameter1 = "value"
          Parameter2 = "value"
          }
      }
    }
  }
}

Thanks

0

There are 0 best solutions below