WeihanLi / WeihanLi.Npoi

NPOI Extensions, excel/csv importer/exporter for IEnumerable<T>/DataTable, fluentapi(great flexibility)/attribute configuration

Home Page:https://weihanli.github.io/WeihanLi.Npoi/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ToEntityList 不支持以 Tab 分隔的 csv 文件

compass-yan opened this issue · comments

csv 文件中不是按照列来分隔,而是用 tab 分隔的整行文字。

你可以试一下指定 CSV 分隔符为 \t

public static char CsvSeparatorCharacter = ',';

CsvHelper.CsvSeparatorCharacter = '\t';

测试了一下应该是可以的,可以参考这个 commit ad68b43

2.0 版本开始单个方法可以指定 CsvOptions,通过方法参数指定 option 中的 SeparatorCharacter 可以不用修改默认配置