コード例 #1
0
 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);
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 /// <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, ",");
 }
コード例 #4
0
 public static string Encode(CsvData csvData)
 {
     return Encode(csvData, null);
 }