Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# csvhelper

void Main()
{
    var records = new List<dynamic>();
    
    dynamic record = new ExpandoObject();
    record.Id = 1;
    record.Name = "one";
    records.Add(record);
    
    using (var writer = new StringWriter())
    using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
    {
        csv.WriteRecords(records);
        
        writer.ToString().Dump();
    }
}
Comment

csharp csvhelper

using (TextWriter writer = new StreamWriter(@"C:	est.csv", false, System.Text.Encoding.UTF8))
{
    var csv = new CsvWriter(writer);
    csv.WriteRecords(values); // where values implements IEnumerable
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: player input manager join manually 
Csharp :: dxf read c# 
Csharp :: print c# 
Csharp :: onmousedown not working unity 
Csharp :: c# datagridview set column header alignment 
Csharp :: c# convert date to oracle format 
Csharp :: audio unity 
Csharp :: c# find element in list of list 
Csharp :: C# 1 minute delay 
Csharp :: reverse a linked list C# 
Csharp :: How to make a simple console select screen using C# ReadKey 
Csharp :: C# Linq item index 
Csharp :: c# find comma in text and remove 
Csharp :: itext7 pdfwriter outputstream c# 
Csharp :: wpf listboxitem event command 
Csharp :: c# group array based on first character 
Csharp :: conncet oracle database in c# visual studio 
Csharp :: top down view movement script 
Csharp :: how to print to printer in c# 
Csharp :: c# integer part of float 
Csharp :: unity collapse hierarchy script 
Csharp :: how to call an If statement only once in C# 
Csharp :: c# convert excel column index to letter 
Csharp :: c# guid from string 
Csharp :: c# system cryptography hash string 
Csharp :: Palindromic substrings 
Csharp :: c# if break 
Csharp :: wpf databinding 
Csharp :: except method c# 
Csharp :: c# list to observablecollection 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =