Skip to content

Commit 249b0ed

Browse files
committed
Docs update
1 parent 399a338 commit 249b0ed

File tree

11 files changed

+139
-26
lines changed

11 files changed

+139
-26
lines changed

docs/api/properties/commentstoken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _Yes_
3232
|**_Accesor_**|**_Parameters_**|
3333
|:----------|:----------|
3434
|Get|_None_|
35-
|Let|*Name*: Token:<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
35+
|Let|*Name*: Token<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
3636

3737
|**_Accesor_**|**_Returns Type_**|
3838
|:----------|:----------|

docs/api/properties/endingrecord.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: RecNumber:<br>*Type*: `Long`<br>*Modifiers*: `ByVal`|
32+
|Let|*Name*: RecNumber<br>*Type*: `Long`<br>*Modifiers*: `ByVal`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/api/properties/escapetoken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: Token:<br>*Type*: `EscapeTokens`/`Long`<br>*Modifiers*: `ByVal`|
32+
|Let|*Name*: Token<br>*Type*: `EscapeTokens`/`Long`<br>*Modifiers*: `ByVal`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/api/properties/fieldsdelimiter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: Delimiter:<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
32+
|Let|*Name*: Delimiter<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/api/properties/quotingmode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: Mode:<br>*Type*: `QuotationMode`/`Long`<br>*Modifiers*: `ByRef`|
32+
|Let|*Name*: Mode<br>*Type*: `QuotationMode`/`Long`<br>*Modifiers*: `ByRef`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/api/properties/recordsdelimiter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: Delimiter:<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
32+
|Let|*Name*: Delimiter<br>*Type*: `String`<br>*Modifiers*: `ByVal`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/api/properties/startingrecord.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _Yes_
2929
|**_Accesor_**|**_Parameters_**|
3030
|:----------|:----------|
3131
|Get|_None_|
32-
|Let|*Name*: RecNumber:<br>*Type*: `Long`<br>*Modifiers*: `ByVal`|
32+
|Let|*Name*: RecNumber<br>*Type*: `Long`<br>*Modifiers*: `ByVal`|
3333

3434
|**_Accesor_**|**_Returns Type_**|
3535
|:----------|:----------|

docs/examples/exportation-examples.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ End Sub
5353
The [EXAMPLE2] shows how you can export all the data in VBA array to a CSV file without check the RFC-4180 specs rules. Be careful, use this only if the array doesn't hold especial chars (vbCrLf [vbCr, vbLf], comma [semicolon], double quotes[apostrophe]) in neither of its fields. The output CSV file has neither field needing to be escaped.
5454

5555
See also
56-
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeType](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetype.html).
56+
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeTokens](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetokens.html).
5757

5858
#### [EXAMPLE2]
5959
>📝**Note**
6060
>{: .text-grey-lt-000 .bg-green-000 }
61-
>the example uses the option `QuotationMode.All`, and `EscapeType.NullChar`.
61+
>the example uses the option `QuotationMode.All`, and `EscapeTokens.NullChar`.
6262
{: .text-grey-dk-300 .bg-grey-lt-000 }
6363

6464
```vb
@@ -78,21 +78,21 @@ Sub ExportToCSV()
7878
'@---------------------------------------------------------------------------------
7979
' Exportation code block start
8080
Call CSVix.OpenConnection(outputFile, DeleExistingFile:=True) 'Open a physical connection to the CSV file
81-
CSVix.QuotingMode = All 'Alter behavior for escaped files
82-
CSVix.EscapeChar = NullChar 'Specify that CSV file has neither field needing to be escaped.
81+
CSVix.QuotingMode = QuotationMode.All 'Alter behavior for escaped files
82+
CSVix.EscapeToken = EscapeTokens.NullChar 'Specify that CSV file has neither field needing to be escaped.
8383
Call CSVix.ExportToCSV (MyArray) 'Export the array content
8484
Set CSVix = Nothing 'Terminate the current instance
8585
End Sub
8686
```
8787
The [EXAMPLE3] shows how you can export all the data in VBA array to a CSV file without check the RFC-4180 specs rules. Each field CSV of the output file need to be escaped by desired char. The procedure presented in the [EXAMPLE3] can be used in whatever circumstance.
8888

8989
See also
90-
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeType](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetype.html).
90+
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeTokens](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetokens.html).
9191

9292
#### [EXAMPLE3]
9393
>📝**Note**
9494
>{: .text-grey-lt-000 .bg-green-000 }
95-
>the example uses the option `QuotationMode.All`, and `EscapeType.NullChar`.
95+
>the example uses the option `QuotationMode.All`, and `EscapeTokens.Apostrophe`.
9696
{: .text-grey-dk-300 .bg-grey-lt-000 }
9797

9898
```vb
@@ -112,8 +112,8 @@ Sub ExportToCSV()
112112
'@---------------------------------------------------------------------------------
113113
' Exportation code block start
114114
Call CSVix.OpenConnection(outputFile, DeleExistingFile:=True) 'Open a physical connection to the CSV file
115-
CSVix.QuotingMode = All 'Alter behavior for escaped files
116-
CSVix.EscapeChar = Apostrophe 'Each CSV’s field need to be escaped with this char.
115+
CSVix.QuotingMode = QuotationMode.All 'Alter behavior for escaped files
116+
CSVix.EscapeToken = EscapeTokens.Apostrophe 'Each CSV’s field need to be escaped with this char.
117117
Call CSVix.ExportToCSV (MyArray) 'Export the array content
118118
Set CSVix = Nothing 'Terminate the current instance
119119
End Sub

docs/examples/fileconversion.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: default
3+
title: File Conversion
4+
parent: Examples
5+
nav_order: 3
6+
---
7+
8+
{: .no_toc }
9+
10+
<details open markdown="block">
11+
<summary>
12+
Table of contents
13+
</summary>
14+
{: .text-delta }
15+
1. TOC
16+
{:toc}
17+
</details>
18+
19+
>📝**Note**
20+
>{: .text-grey-lt-000 .bg-green-000 }
21+
>All the examples uses the option `QuotationMode.Critical`, [learn more here](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html).
22+
{: .text-grey-dk-300 .bg-grey-lt-000 }
23+
24+
## Convert a CSV file to TSV
25+
26+
The [EXAMPLE1] shows how you can turn a CSV file to TSV.
27+
28+
#### [EXAMPLE1]
29+
30+
```vb
31+
Sub ExportToCSV_RFC4180()
32+
Dim CSVix As CSVinterface
33+
Dim MyArray() As String
34+
Dim filePath As String, tmpCSV As String
35+
Dim outputFile As String
36+
37+
filePath = "C:\Demo_400k_records.csv" 'Change this to suit your needs
38+
outputFile = "C:\Demo_400k_records.tsv" 'Change this to suit your needs
39+
40+
Set CSVix = New CSVinterface 'Create new instance
41+
tmpCSV = CSVix.GetDataFromCSV(filePath) 'Store CSV file's content.
42+
CSVix.EndingRecord = 10 'Sets the importation ending
43+
Call CSVix.ImportFromCSVString(tmpCSV) 'Import the range of records
44+
Call CSVix(MyArray) 'Dumps the data to array
45+
'@---------------------------------------------------------------------------------
46+
' Exportation code block start
47+
CSVix.FieldsDelimiter = vbTab
48+
Call CSVix.OpenConnection(outputFile, DeleExistingFile:=True) 'Open a physical connection to the TSV file
49+
Call CSVix.ExportToCSV (MyArray) 'Export the array content
50+
Set CSVix = Nothing 'Terminate the current instance
51+
End Sub
52+
```
53+
54+
## Convert a TSV file to CSV
55+
56+
The [EXAMPLE2] shows how you can turn a TSV file to CSV.
57+
58+
#### [EXAMPLE2]
59+
60+
```vb
61+
Sub ExportToCSV_RFC4180()
62+
Dim CSVix As CSVinterface
63+
Dim MyArray() As String
64+
Dim filePath As String, tmpCSV As String
65+
Dim outputFile As String
66+
67+
filePath = "C:\Demo_400k_records.tsv" 'Change this to suit your needs
68+
outputFile = "C:\Demo_400k_records.csv" 'Change this to suit your needs
69+
70+
Set CSVix = New CSVinterface 'Create new instance
71+
tmpCSV = CSVix.GetDataFromCSV(filePath) 'Store TSV file's content.
72+
CSVix.EndingRecord = 10 'Sets the importation ending
73+
Call CSVix.ImportFromCSVString(tmpCSV) 'Import the range of records
74+
Call CSVix(MyArray) 'Dumps the data to array
75+
'@---------------------------------------------------------------------------------
76+
' Exportation code block start
77+
CSVix.FieldsDelimiter = ","
78+
Call CSVix.OpenConnection(outputFile, DeleExistingFile:=True) 'Open a physical connection to the CSV file
79+
Call CSVix.ExportToCSV (MyArray) 'Export the array content
80+
Set CSVix = Nothing 'Terminate the current instance
81+
End Sub
82+
```

docs/examples/importation-examples.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ End Sub
118118

119119
## Import CSV file that haven’t special syntax
120120

121-
This is the fastest way to work with CSV files because the CSV interface class don't check the syntax given at the RFC-4180 specs. If your CSV files has trailing spaces, or you don't know if it holds a field needing to be escaped, please [reset the config options](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/resettodefault.html) for the current instance to avoid incorrect results.
121+
This is the fastest way to work with CSV files because the CSV interface class don't check the syntax against the RFC-4180 specs. If your CSV files has trailing spaces, or you don't know if it holds a field needing to be escaped, please [reset the config options](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/resettodefault.html) for the current instance to avoid incorrect results.
122122

123-
The [EXAMPLE5] shows how you can import all the data from a CSV file without checking the syntax given at the RFC-4180 specs. The file to be parsed has neither field needing to be escaped.
123+
The [EXAMPLE5] shows how you can import all the data from a CSV file without checking the RFC-4180 specs. The file to be parsed has neither field needing to be escaped.
124124

125125
See also
126-
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeType](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetype.html).
126+
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeTokens](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetokens.html).
127127
#### [EXAMPLE5]
128128
>📝**Note**
129129
>{: .text-grey-lt-000 .bg-green-000 }
130-
>the example uses the option `QuotationMode.All`, and `EscapeType.NullChar`.
130+
>the example uses the option `QuotationMode.All`, and `EscapeTokens.NullChar`.
131131
{: .text-grey-dk-300 .bg-grey-lt-000 }
132132

133133
```vb
@@ -139,8 +139,8 @@ Sub ImportRecords()
139139
filePath = "C:\Demo_400k_records.csv" 'Change this to suit your needs
140140
Set CSVix = New CSVinterface 'Create new instance
141141
Call CSVix.OpenConnection(fileName) 'Open a physical connection to the CSV file
142-
CSVix.QuotingMode = All 'Alter behavior for escaped files
143-
CSVix.EscapeChar = NullChar 'Specify that CSV file has neither field needing to be escaped.
142+
CSVix.QuotingMode = QuotationMode.All 'Alter behavior for escaped files
143+
CSVix.EscapeToken = EscapeTokens.NullChar 'Specify that CSV file has neither field needing to be escaped.
144144
Call CSVix.ImportFromCSV 'Import data
145145
Call CSVix(MyArray) 'Dumps the data to array
146146
Set CSVix = Nothing 'Terminate the current instance
@@ -161,14 +161,14 @@ Sub ImportRecords_RFC4180()
161161
Set CSVix = Nothing 'Terminate the current instance
162162
End Sub
163163
```
164-
The [EXAMPLE7] shows how you can import all the data from a CSV file without checking the syntax given at the RFC-4180 specs. In the file to be parsed, all fields need to be escaped.
164+
The [EXAMPLE7] shows how you can import all the data from a CSV file without checking the RFC-4180 specs. In the file to be parsed, all fields need to be escaped.
165165

166166
See also
167-
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeType](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetype.html).
167+
:[QuotationMode](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/quotationmode.html), [EscapeTokens](https://ws-garcia.github.io/VBA-CSV-interface/api/enumerations/escapetokens.html).
168168
#### [EXAMPLE7]
169169
>📝**Note**
170170
>{: .text-grey-lt-000 .bg-green-000 }
171-
>the example uses the option `QuotationMode.All`, and `EscapeType.DoubleQuotes`.
171+
>the example uses the option `QuotationMode.All`, and `EscapeTokens.DoubleQuotes`.
172172
{: .text-grey-dk-300 .bg-grey-lt-000 }
173173

174174
```vb
@@ -180,8 +180,8 @@ Sub ImportRecords()
180180
filePath = "C:\Demo_Headed_400k_records.csv" 'Change this to suit your needs
181181
Set CSVix = New CSVinterface 'Create new instance
182182
Call CSVix.OpenConnection(fileName) 'Open a physical connection to the CSV file
183-
CSVix.QuotingMode = All 'Alter behavior for escaped files
184-
CSVix.EscapeChar = DoubleQuotes 'Specify that all fields need to be escaped.
183+
CSVix.QuotingMode = QuotationMode.All 'Alter behavior for escaped files
184+
CSVix.EscapeToken = EscapeTokens.DoubleQuotes 'Specify that all fields need to be escaped.
185185
Call CSVix.ImportFromCSV 'Import data
186186
Call CSVix(MyArray) 'Dumps the data to array
187187
Set CSVix = Nothing 'Terminate the current instance

0 commit comments

Comments
 (0)