如何用逗号读取csv文件?

时间:2015-04-21 09:10:41

标签: asp-classic

这是我使用asp读取csv文件的代码。但如果该领域内有逗号,我会遇到问题。

Set objFSO = CreateObject("Scripting.FileSystemObject")

'*** Check Exist Files ***'
If Not objFSO.FileExists(Server.MapPath(sFileName)) Then
Response.write("File not found.")
Else

'*** Open Files ***'
Set oInStream = objFSO.OpenTextFile(Server.MapPath(sFileName),1,False)

Do Until oInStream.AtEndOfStream
sRows = oInStream.readLine
arrRows = Split(sRows,",")

response.write(arrRows(0))
response.write(arrRows(1))
Loop
oInStream.Close()
Set oInStream = Nothing

End IF

0 个答案:

没有答案