public WriteCsvGrammar(int columnCount, string title) { _title = title; for (var i = 0; i < columnCount; i++) { var cell = Cell.For <string>($"col{i + 1}"); cell.header = $"Column {i + 1}"; CsvCells.Add(cell); } }
public WriteCsvGrammar(string title, params string[] headers) : this(headers.Length, title) { WriteCellHeadersInFirstLine = true; for (var i = 0; i < headers.Length; i++) { var key = headers[i].Replace(" ", "_"); var cell = Cell.For <string>(key); cell.header = headers[i]; CsvCells.Add(cell); } }