-2
我有一个CSV用数据如以下仅删除尾部空格和间隔在空字段
“01”,“567”,””,‘这是一个消息’
我需要删除空白字段中的尾部空格和空格,同时保留数据之间的空格。
我的代码:
Dim inStream : Set inStream...
With inStream
.open
.type = 2
.charset = "utf-8"
.loadfromfile src
Dim outStream : Set outStream...
outStream.open
outStream.type = 2
While Not .EOS
arrLine = split(.read, ",")
strLine = trim(arrLine(0))
If ubound(arrLine) > 0 Then
For intField = 1 To ubound(arrLine)
strLine = strLine & "," & trim(arrLine(intField))
Next
End If
outStream.write(strLine)
outStream.savetofile dest, create
WEnd
outStream.close
.close
End With
Cab你举了一个输入数据和预期结果的例子吗?我没有真正得到问题陈述“我需要删除空白字段中的尾部空格和空格,同时保留数据之间的空格” – olyv