Csvhelper: “没有找到标题记录。”

创建于 2017-10-21  ·  3评论  ·  资料来源: JoshClose/CsvHelper

首先,让我感谢 CSVhelper 的所有贡献者,他们制作了如此有用且经过深思熟虑的软件包。 但是,我遇到以下问题:

当我更新到最新版本 (v4.0.2) 时,我无法读取我正在使用的 CSV 文件的标题记录,即使这在以前的版本中运行良好。

下面是我用来读取标题的代码片段的测试示例。

使用 (var FlReader = File.OpenText(@"E:Developement\CSV\CSVtestXLS.csv"))
{
CsvReader csv = 新 CsvReader(FlReader);
csv.Configuration.HasHeaderRecord = true;

                csv.ReadHeader();
                var myCsv = csv.Context.HeaderRecord;



                }
                csv.Dispose();

最有用的评论

您需要先调用 Read()。 请参阅此处的 ReadHeader https://joshclose.github.io/CsvHelper/reading#reading -records

所有3条评论

您需要先调用 Read()。 请参阅此处的 ReadHeader https://joshclose.github.io/CsvHelper/reading#reading -records

嗨,马克,

感谢您的快速回复。

德米特里厄斯

[/Volumes/Seagate Backup Plus Drive/Allison/Logos/DirecPathLogo_NoTag_CMYK-01.png]

德米特里·索蒂里亚德斯 | 报告分析师

直接:414.270.2865 | 传真:414.271.1795
DirectPathHealth.com http://directpathhealth.com/

保密声明:此电子邮件通信和任何附件可能包含机密和特权信息,供上述指定收件人使用。 如果您不是预期的收件人,特此通知您,您错误地收到了此通信,并且禁止对其或其内容进行任何审查、披露、传播、分发或复制。 如果您错误地收到此通信,请立即通过回复此消息并将其从您的计算机中删除来通知我。

来自:markgould [mailto:[email protected]]
发送:2017 年 10 月 21 日星期六下午 2:13
致:JoshClose/CsvHelper [email protected]
抄送:Demetrius Sotiriades [email protected] ; 作者[email protected]
主题:回复:[JoshClose/CsvHelper]“未找到标头记录。” (#808)

您需要先调用 Read()。 请参阅此处的 ReadHeader https://joshclose.github.io/CsvHelper/reading#reading -records


您收到此消息是因为您编写了该主题。
直接回复此邮件,在 GitHub 上查看https://github.com/JoshClose/CsvHelper/issues/808#issuecomment-338425719 ,或将帖子静音https://github.com/notifications/unsubscribe-auth/AfdSFFNAqHnKE_NukWUgPKCYxhMF97Puks5sukI_gaJpZM4QBpJT

您需要先调用 Read()。 请参阅此处的 ReadHeader https://joshclose.github.io/CsvHelper/reading#reading -records

通过搜索引擎登陆此问题页面,发现此处提供的链接似乎已损坏。 更新的链接在这里是为了未来的读者https://joshclose.github.io/CsvHelper/examples/reading/reading-by-hand

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

Wagimo picture Wagimo  ·  4评论

mabead picture mabead  ·  3评论

RifS picture RifS  ·  5评论

Dushyant262 picture Dushyant262  ·  4评论

DmitryEfimenko picture DmitryEfimenko  ·  3评论