CSV列数据正在被截断 [英] CSV column data is being truncated

查看:135
本文介绍了CSV列数据正在被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Jet使用连接字符串解析CSV文件

I am parsing a CSV file using Jet with the connection string

@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory + ";Extended Properties='text;HDR=YES;FMT=Delimited';"

使用包含以下内容的Schema.ini:

with a Schema.ini containing:

[SelfCatering.csv]
Format=CSVDelimited
ColNameHeader=True
MaxScanRows=0

在我的c#代码中我已预定义列数据类型为字符串,但由于某种原因扩展字符串列被截断为255个字符。如果我快速查看列数据本身只有255个字母长

In my c# code I have predefined the column data types as string but for some reason extended string columns are being truncated at 255 characters. If I quick watch the column data itself is it only 255 letters long

其他地方会被截断吗?

谢谢

推荐答案

不要使用 Jet OLEDB 4.0 截断你的长文本为255个字符,它将只读取255列/字段。

Dont use Jet OLEDB 4.0 driver, it will truncate your long text to 255 chars and it will read only 255 columns/fields. If you have more than 255 columns/fields you will not be able to read them all.

StackOverflow上的其他人建议使用:快速CSV阅读器

Other people on StackOverflow suggests to use: A Fast CSV Reader

这篇关于CSV列数据正在被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆