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 :: c# .net 3.5 post json httpclient 
Csharp :: unity set sprite image from script 
Csharp :: c# picturebox transparente 
Csharp :: c# constructor call another constructor 
Csharp :: c# convert enumb to int array 
Csharp :: unity get component in parent 
Csharp :: comments in c# 
Csharp :: how to locate a specific element in a list c# 
Csharp :: .net core identity get user id 
Csharp :: c# read all lines from filestream 
Csharp :: c# create excel file 
Csharp :: c# code skripte kommunizieren 
Csharp :: c# sort int array 
Csharp :: all Substring of String 
Csharp :: what value of combobox index c# 
Csharp :: unity detect a touch on ui element 
Csharp :: unity time scale 
Csharp :: c# how to call methods from another class 
Csharp :: to list c# 
Csharp :: c# loop array 
Csharp :: visual studio c# mark class deprecated 
Csharp :: linq datatable 
Csharp :: unity check if current scene is being unloaded 
Csharp :: slither io hack 
Csharp :: visitor pattern 
Csharp :: how to see if a number is even c# 
Csharp :: how to use buildcontext in initstate flutter 
Csharp :: c# callback using delegate 
Csharp :: constructor in c# 
Csharp :: stock span problem c# using class 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =