数据库

位置:IT落伍者 >> 数据库 >> 浏览文章

解决CSV字段数据带有双引号的问题


发布日期:2019年12月01日
 
解决CSV字段数据带有双引号的问题

主要解决CSV字段数据带有双引号的问题

具体代码如下

Public Function ChangeCsvSplitLine(ByVal strLine As String ByVal iColNumber As Integer) As String()

Dim strList() As String = strLineSplit()

If strListLength = iColNumber Then

Return strList

End If

Dim i As Integer =

Dim findSplitIndex As Integer =

Dim index As Integer =

Dim returnList(iColNumber) As String

Dim strMerger As String =

For i = To strListLength

If findSplitIndex = Then

If (strList(i)() = And strList(i)(strList(i)Length ) <> ) _

Or (strList(i)Length = And strList(i) = ) Then

findSplitIndex = i

Else

returnList(index) = strList(i)

index = index +

End If

Else

If (strList(i)() <> And strList(i)(strList(i)Length ) = ) _

Or (strList(i)Length = And strList(i) = ) Then

strMerger =

For findSplitIndex = findSplitIndex To i

strMerger = strMerger & strList(findSplitIndex) &

Next

strMerger = strMergerSubstring( strMergerLength )

returnList(index) = strMerger

index = index +

findSplitIndex =

End If

End If

Next

Return returnList

End Function

上一篇:使用ADO对象连接SQL Server数据库

下一篇:使用动态数据库访问对象