主要解決CSV字段數據帶有雙引號的問題
具體代碼如下
Public Function ChangeCsvSplitLine(ByVal strLine As String
Dim strList() As String = strLine
If strList
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 =
If findSplitIndex =
If (strList(i)(
Or (strList(i)
findSplitIndex = i
Else
returnList(index) = strList(i)
index = index +
End If
Else
If (strList(i)(
Or (strList(i)
strMerger =
For findSplitIndex = findSplitIndex To i
strMerger = strMerger & strList(findSplitIndex) &
Next
strMerger = strMerger
returnList(index) = strMerger
index = index +
findSplitIndex =
End If
End If
Next
Return returnList
End Function
From:http://tw.wingwit.com/Article/program/net/201311/15450.html