public static string Encode(CsvData csvData, Dictionary<int, FieldFormatOption> formatOptions, string separator) { CsvEncoder encoder = new CsvEncoder(); encoder.FormatOptions = formatOptions; encoder.Separator = separator; return encoder.EncodeCsvData(csvData); }
private string EncodeCsvData(CsvData csvData) { StringBuilder text = new StringBuilder(); text.AppendLine(EncodeRecord(csvData.Header)); text.AppendLine("\n"); text.AppendLine(EncodeRecord(csvData.Record)); text.AppendLine("\n"); return text.ToString(); }
/// <summary> /// Encode CsvData with Format Options /// </summary> /// <param name="csvData"></param> /// <param name="formatOptions">FieldFormatOption /// dict that use 0 based field index as key</param> public static string Encode(CsvData csvData, Dictionary<int, FieldFormatOption> formatOptions) { return Encode(csvData, formatOptions, ","); }
public static string Encode(CsvData csvData) { return Encode(csvData, null); }