コード例 #1
0
        public override void SetUp()
        {
            base.SetUp();

            myFormat                    = new SeparatorSeriesFormat("test");
            myFormat.Separator          = ";";
            myFormat.Anchor             = Anchor.ForRow(new StringContainsLocator(1, "DE0005151005"));
            myFormat.Expand             = CellDimension.Row;
            myFormat.TimeAxisPosition   = 0;
            myFormat.SeriesNamePosition = 1;
            myFormat.SkipColumns        = new int[] { 0, 2, 3 };
            myFormat.SkipRows           = new int[] { 1 };

            myEpsFile = Path.Combine(TestDataRoot, "Recognition", "eps.csv");
        }
コード例 #2
0
ファイル: TextDocument.cs プロジェクト: riyanhax/Maui
        public DataTable ExtractTable(IFormat format)
        {
            SeparatorSeriesFormat separatorSeriesFormat = format as SeparatorSeriesFormat;
            CsvFormat             csvFormat             = format as CsvFormat;

            if (csvFormat != null)
            {
                DataTable result = CsvReader.Read(Location, csvFormat.Separator);
                return(csvFormat.ToFormattedTable(result));
            }
            else if (separatorSeriesFormat != null)
            {
                DataTable result = CsvReader.Read(Location, separatorSeriesFormat.Separator);
                return(separatorSeriesFormat.ToFormattedTable(result));
            }
            else
            {
                throw new NotSupportedException("Format not supported for text files: " + format.GetType());
            }
        }
コード例 #3
0
        private DataTable Parse(SeparatorSeriesFormat format, string file)
        {
            var rawTable = CsvReader.Read(file, format.Separator);

            return(format.ToFormattedTable(rawTable));
        }