diff --git a/writefrudata.cpp b/writefrudata.cpp
index 635653f..b36de7e 100644
--- a/writefrudata.cpp
+++ b/writefrudata.cpp
@@ -367,6 +367,7 @@
 
 std::string getFRUValue(const std::string& section,
                         const std::string& key,
+                        const std::string& delimiter,
                         IPMIFruInfo& fruData)
 {
 
@@ -400,6 +401,22 @@
     {
         fruValue = itr->second;
     }
+
+    //if the key is custom property then the value could be in two formats.
+    //1) custom field 2 = "value".
+    //2) custom field 2 =  "key:value".
+    //if delimeter length = 0 i.e custom field 2 = "value"
+
+    constexpr auto customProp = "Custom Field";
+    if (key.find(customProp) != std::string::npos)
+    {
+       if (delimiter.length() > 0)
+       {
+           size_t delimiterpos = fruValue.find(delimiter);
+           if (delimiterpos != std::string::npos)
+               fruValue = fruValue.substr(delimiterpos + 1);
+       }
+    }
     return fruValue;
 
 }
@@ -507,7 +524,7 @@
             PropertyMap props;//store all the properties
             for (auto& properties : interfaceList.second)
             {
-                std::string section, property, value;
+                std::string section, property, delimiter, value;
                 for (auto& info : properties.second)
                 {
                     if (info.first == "IPMIFruSection")
@@ -518,11 +535,26 @@
                     {
                         property = std::move(info.second);
                     }
+                    if (info.first == "IPMIFruValueDelimiter")
+                    {
+                        //Read the delimeter as ascii value
+                        //convert it into char
+                        if( info.second.length() > 0 )
+                        {
+                            char dlm = ' ';
+                            rc = sscanf(info.second.c_str(),"%hhd",&dlm);
+                            if (rc > 0)
+                            {
+                                delimiter = std::string(1,dlm);
+                            }
+                        }
+                    }
+
                 }
 
                 if (!section.empty() && !property.empty())
                 {
-                    value = getFRUValue(section, property, fruData);
+                    value = getFRUValue(section, property, delimiter, fruData);
                 }
                 props.emplace(std::move(properties.first), std::move(value));
             }
