这是我使用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