在逗号分隔文件中读取逗号 [英] Read Comma in comma separated file

查看:74
本文介绍了在逗号分隔文件中读取逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想批量插入一个文件,例如



1,1,500,200



1,500我想插入单个列但插入1 在一列中, 500到另一列



有没有办法批量插入这种类型的文件



我的代码是这样的



I want to bulk insert a file like

1,"1,500",200

"1,500" I want to insert into a single column but it inserts "1 in one column and 500" into another column

is there any way for bulk insert such type of file

my code is like this

BULK INSERT #temp FROM 'C:\Uploads\testfile.csv' WITH ( FIELDTERMINATOR = ',' ,ROWTERMINATOR = '\n',CHECK_CONSTRAINTS)

推荐答案

检查这个代码。

Dim sValueAs String = 1,1,500,200

Dim words As String()= sValue.Split(New Char(){c})



U get Value 1 ,1,500和最后,200
Check This Code.
Dim sValueAs String=1,"1,500",200
Dim words As String() = sValue.Split(New Char() {"""c})

U get Value 1, after 1,500 and Last ,200


这篇关于在逗号分隔文件中读取逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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