Example #1
0
        public static GCSVTable ReadFromFile(DelimReader delimReader, string filePath)
        {
            GCSVReader reader = new GCSVReader();

            List<string[]> lines = delimReader.ReadToStringArray(filePath);

            int position = 0;

            var result = reader.ReadGCSVFromLines(lines, ref position);
            if (result == null)
                throw new ArgumentException(string.Format("No Gcsv header found in input file {0}", filePath), "filePath");
            return result;
        }
Example #2
0
        public static GCSVCollection ReadMultipleFromFile(DelimReader delimReader, string filePath)
        {
            GCSVReader reader = new GCSVReader();
            GCSVCollection collection = new GCSVCollection();

            List<string[]> lines = delimReader.ReadToStringArray(filePath);

            int position = 0;

            while (position < lines.Count)
            {
                GCSVTable single = reader.ReadGCSVFromLines(lines, ref position);
                if (single == null)
                {
                    throw new ArgumentException(string.Format("No Gcsv headers found in input file {0}", filePath), "filePath");
                }
                collection.Add(single.Name, single);
            }

            return collection;
        }