diff --git a/encog-core-cs/Util/CSV/ParseCSVLine.cs b/encog-core-cs/Util/CSV/ParseCSVLine.cs index 48f02f0b..2b874e52 100644 --- a/encog-core-cs/Util/CSV/ParseCSVLine.cs +++ b/encog-core-cs/Util/CSV/ParseCSVLine.cs @@ -65,6 +65,11 @@ private IList ParseCharSep(string line) char ch = line[i]; if ((ch == Format.Separator) && !quoted) { + //If value is empty string, that means value is missing, in Encog terms unkown or missing value is represnted with "?" + if (item.Length == 0) + { + item.Append("?"); + } String s = item.ToString(); if (!hadQuotes) { @@ -72,6 +77,8 @@ private IList ParseCharSep(string line) } result.Add(s); item.Length = 0; + //We just process "a seperator" that means we are expecting value after the sperator, if it does not present then "?" is going to be the default value. which means missing value in Encog terms. + item.Append("?"); quoted = false; hadQuotes = false; } @@ -86,6 +93,11 @@ private IList ParseCharSep(string line) } else { + //We found as valid value so remove the missing value character. + if (item.ToString() == "?") + { + item.Length--; + } item.Append(ch); } }