File tree Expand file tree Collapse file tree 1 file changed +24
-15
lines changed
Expand file tree Collapse file tree 1 file changed +24
-15
lines changed Original file line number Diff line number Diff line change 11Attribute VB_Name = "CSVinterfaceTest"
22Option 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
2635End Sub
You can’t perform that action at this time.
0 commit comments