Пример #1
0
        public void Write(Table table)
        {
            using (var sw = new StreamWriter(_filename))
            {
                var rows = new List<Table.TableRow> {table.Header};
                rows.AddRange(table.Rows);

                foreach (var row in rows)
                {
                    var first = true;

                    foreach (var column in row.columns)
                    {
                        if (!first)
                            sw.Write(",");
                        else first = false;

                        sw.Write(PrepareCsvCol(column));
                    }

                    sw.Write(Environment.NewLine);
                }
            }
        }
Пример #2
0
 public Parser(Config config, Table.TableRow headerRow)
 {
     _table = new Table(headerRow.columns.Count)
                  {Header = headerRow};
     _config = config;
 }