Ejemplo n.º 1
0
        // Static methods
        #region ParseFile
        public static IList <string> ParseFile(string path)
        {
            // This data will still need to be delimited by TAB, but it will be sanitized.
            // The data may not be valid, though. And that's up to the classes that consume it.

            List <string> data = new List <string>();

            foreach (var ITEM in System.IO.File.ReadAllLines(path))
            {
                if (String.IsNullOrWhiteSpace(ITEM))
                {
                    continue;
                }

                string value = ITEM.Trim();
                if (value.StartsWith("#") ||
                    value.StartsWith("["))
                {
                    continue;
                }

                data.Add(value);
            }
            return(data);
        }