You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/examples/exportation-examples.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,12 +53,12 @@ End Sub
53
53
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.
CallCSVix.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.
83
83
CallCSVix.ExportToCSV(MyArray)'Export the array content
84
84
SetCSVix=Nothing'Terminate the current instance
85
85
EndSub
86
86
```
87
87
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.
>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
+
SubExportToCSV_RFC4180()
32
+
DimCSVixAsCSVinterface
33
+
DimMyArray()AsString
34
+
DimfilePathAsString,tmpCSVAsString
35
+
DimoutputFileAsString
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
Copy file name to clipboardExpand all lines: docs/examples/importation-examples.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,16 +118,16 @@ End Sub
118
118
119
119
## Import CSV file that haven’t special syntax
120
120
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.
122
122
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.
>the example uses the option `QuotationMode.All`, and `EscapeType.NullChar`.
130
+
>the example uses the option `QuotationMode.All`, and `EscapeTokens.NullChar`.
131
131
{: .text-grey-dk-300 .bg-grey-lt-000 }
132
132
133
133
```vb
@@ -139,8 +139,8 @@ Sub ImportRecords()
139
139
filePath="C:\Demo_400k_records.csv"'Change this to suit your needs
140
140
SetCSVix=NewCSVinterface'Create new instance
141
141
CallCSVix.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.
144
144
CallCSVix.ImportFromCSV'Import data
145
145
CallCSVix(MyArray)'Dumps the data to array
146
146
SetCSVix=Nothing'Terminate the current instance
@@ -161,14 +161,14 @@ Sub ImportRecords_RFC4180()
161
161
SetCSVix=Nothing'Terminate the current instance
162
162
EndSub
163
163
```
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.
0 commit comments