ExcelHelperReadCSVT(Stream, CsvConfiguration) Method
讀取CSV文件並轉換為物件
Namespace: eBizprise.UtilityAssembly: eBizprise.Utility.ExcelHelper (in eBizprise.Utility.ExcelHelper.dll) Version: 25.0.1.0+9af286275430f5cdff066120a88db0d7edbaef7c
public static List<T> ReadCSV<T>(
Stream stream,
CsvConfiguration configuration
)
- stream Stream
- 資料流
- configuration CsvConfiguration
- 讀取設定
- T
- 物件
ListTList<T>
using (FileStream fileStream = new FileStream("ExcelHelperTest.csv", FileMode.Open))
{
List<Employee> employees = ExcelHelper.ReadCSV<Employee>(fileStream, new CsvConfiguration());
// 其它作業
}
| Date | Version | Description |
|---|
| 2020/02/07 | 1.0.0.0 | 初版 |
| 2021/06/25 | 1.0.3.0 | 修正讀取含雙引號的內容時解析錯誤 |
| 2021/07/21 | 1.0.4.0 | 調整分隔字元可接受字串 |
| 2021/08/05 | 1.0.5.0 | 修正分隔字元非逗號時無法正常解析 |
| 2021/08/18 | 1.0.6.0 | 調整CSV改以CsvHelper元件處理 |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |