Skip to content

Commit 6198ac8

Browse files
committed
Update CSVinterfaceTest.bas
1 parent 4da882b commit 6198ac8

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

src/CSVinterfaceTest.bas

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
Attribute VB_Name = "CSVinterfaceTest"
22
Option Explicit
3-
Sub Test_Import()
3+
Sub TestImportLikeRFC-4180CSV()
44
Dim CSVix As CSVinterface
5-
Dim s As Double, e As Double, H As Double
6-
Dim fileName As String, i As Single
5+
Dim fileName As String
76
Dim tmpCSV As String
87

98
Set CSVix = New CSVinterface
109

11-
fileName = "C:\Demo_400k_records.csv"
10+
fileName = "C:\RFC-4180_HF.csv"
1211
tmpCSV = CSVix.GetDataFromCSV(fileName)
12+
Call CSVix.ImportFromCSVString(tmpCSV)
13+
If CSVix.ErrNumber <> 0 Then Goto Err_Handler
14+
Set CSVix = Nothing
15+
Exit Sub
16+
Err_Handler:
17+
Debug.Print "Returned Error #", CSVix.ErrNumber; CSVix.ErrDescription
18+
End Sub
1319

14-
H = 0#
15-
For i = 1 To 10
16-
s = Timer
17-
Call CSVix.ImportFromCSVString(tmpCSV)
18-
e = Timer
19-
H = H + (e - s)
20-
Next i
21-
Debug.Print "CSVinterface [ImportFromCSVString]:"; Round(H / 10, 4)
22-
Debug.Print "*********************************************************"
23-
Debug.Print Err.Number
24-
20+
Sub TestImportTSV()
21+
Dim CSVix As CSVinterface
22+
Dim fileName As String
23+
Dim tmpCSV As String
24+
25+
Set CSVix = New CSVinterface
26+
27+
fileName = "C:\TestTSV.tsv"
28+
tmpCSV = CSVix.GetDataFromCSV(fileName)
29+
Call CSVix.ImportFromCSVString(tmpCSV)
30+
If CSVix.ErrNumber <> 0 Then Goto Err_Handler
2531
Set CSVix = Nothing
32+
Exit Sub
33+
Err_Handler:
34+
Debug.Print "Returned Error #", CSVix.ErrNumber; CSVix.ErrDescription
2635
End Sub

0 commit comments

Comments
 (0)