【发布时间】:2018-10-13 21:24:23
【问题描述】:
在接近回答我的问题的this post 之后,我需要一些帮助来设置 FileHelpers。我的银行对账单在实际交易数据上方有一些额外的信息,因此文件如下所示:
Some Header 1,Some Header 2,And Header 3
<summary of the entire file on 5 lines>
Date,Transaction Type,Description,Amount,Running Balance
<actual transaction data, on 5 columns each line>
我有兴趣捕获所有字段(在 DataTable 中),包括摘要。基本上,我希望根据任何行中的最大列数来调整数据表的大小。
Prasanth 提出了替代方案,但我不明白 _fileContent 是什么:
using (MemoryStream stream = new MemoryStream(_fileContent)) //file content can be file as byte array
我已经用 VBA 编写代码多年,最近在 c# 中启动了一个 Excel Com-AddIn,所以我想我更像是一个新手。
提前感谢您! 丹妮
【问题讨论】:
标签: c# csv filehelpers