.net CsvHelper 2.0
http://joshclose.github.io/CsvHelper/ var outputmatchPath = System.Configuration.ConfigurationManager.AppSettings[//FilePath]; TextReader requiredMatchElementsfileReader = File.OpenText(outputmatchPath); var matchCsv = new CsvReader(requir
http://joshclose.github.io/CsvHelper/
var outputmatchPath = System.Configuration.ConfigurationManager.AppSettings["//FilePath"];
TextReader requiredMatchElementsfileReader = File.OpenText(outputmatchPath);var matchCsv = new CsvReader(requiredMatchElementsfileReader);
matchCsv.Configuration.RegisterClassMapRequiredMatchElementsMap>();
var requiredMatchList = matchCsv.GetRecordsRequiredMatchElements>().ToList();
public class RequiredMatchElements
{
public int IngredientId { set; get; }
public string IngredientName { set; get; }
public string RequriedElementsString { set; get; }
}
public class RequiredMatchElementsMap : CsvClassMap
{
public override void CreateMap()
{
Map(m => m.IngredientId).Name("IngredientId");
Map(m => m.IngredientName).Name("IngredientName");
Map(m => m.RequriedElementsString).Name("RequriedElementsString");
}
}
Write
using (TextWriter streamWriter =
new StreamWriter(HttpContext.Current.Server.MapPath("/App_Data/Top5000Instagram.csv")))
{
var csv = new CsvWriter(streamWriter);
csv.WriteRecords(dateList);
}
上一篇: JavaScript模块化开发详细分析
下一篇: 用正则表达式替换内容 php
推荐阅读
-
.NET Framework 4.5 五个很棒的特性分享
-
ASP.NET Razor - C# 逻辑条件
-
一学就会之ado.net(一)
-
数据库和Doctrine(转载自http://www.111cn.net/phper/332/85987.htm),www.111cn.netphper
-
ASP.NET Core MVC 过滤器的使用方法介绍
-
.net 日志系统解析
-
Asp.Net Core基于JWT认证的数据接口网关实例代码
-
ASP.NET jQuery 实例10 动态修改hyperlink的URL值_jquery
-
node.js使用net模块创建服务器和客户端示例【基于TCP协议】
-
ASP.NET Aries 高级开发教程:使用存储过程(番外篇)