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: README.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,14 @@
6
6
7
7
VBA CSV interface is a class module developed to accomplish the data exchange task between VBA arrays and CSV files at high speed. Projects from [@sdkn104](https://github.com/sdkn104/VBA-CSV) and [@Senipah](https://github.com/Senipah/VBA-Better-Array), both on Github, were used for comparative performance purposes.
8
8
9
+
The parser is compatible with those CSV files compliant with the RFC-4180 standard, but add some useful features like:
10
+
* In-line comments (with a user-defined character).
11
+
* Skip blanks lines and empty ones.
12
+
* User-defined escape character (option not available in _Power Query for Excel 2019_ and with some inconsistences when use the _From Text(Legacy)_ wizard)[[1]](#1).
13
+
14
+
<aid="1">[1]</a>
15
+
Power Query, and its legacy counterpart, was not able to handle fields’ embedded line breaks when the CSV's "Text qualifier" is a Single Quote or the Apostrophe char.
16
+
9
17
## Getting started
10
18
11
19
If you don't know how to get started with VBA-CSV Interface class, visit the [documentation repo](https://ws-garcia.github.io/VBA-CSV-interface/).
Copy file name to clipboardExpand all lines: docs/api/enumerations/escapetype.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,13 +27,11 @@ Provides a list of constants for use to configure the char used as escape one.
27
27
28
28
*variable* = `EscapeType`.*Constant*
29
29
30
-
---
31
-
32
-
## Remarks
33
-
34
-
The `EscapeType.NullChar` value is used with the`QuotationMode.All` setting to indicates the CSV file does not use any escape char in its whole length. This values combination conduces the CSV file to be parse/write assuming the `FieldsDelimiter` property is enough for the import/export operations.
35
-
36
-
In the case the `FieldsDelimiter` property is not enough for successfully done the import/export operations, the `QuotationMode.DoubleQuotes` value would be used for parse/write an CSV having fields to be escaped with double quote and the `QuotationMode.Apostrophe` values for parse/write an CSV having fields to be escaped with the apostrophe.
30
+
>:pencil:**NOTE:**
31
+
>
32
+
>The `EscapeType.NullChar` value is used with the`QuotationMode.All` setting to indicates the CSV file does not use any escape char in its whole length. This values combination conduces the CSV file to be parse/write assuming the `FieldsDelimiter` property is enough for the import/export operations.
33
+
>
34
+
>In the case the `FieldsDelimiter` property is not enough for successfully done the import/export operations, the `EscapeType.DoubleQuotes` value would be used for parse/write an CSV having fields to be escaped with double quote and the `EscapeType.Apostrophe` values for parse/write an CSV having fields to be escaped with the apostrophe, using the `QuotationMode.Critical` mode.
Copy file name to clipboardExpand all lines: docs/api/enumerations/quotationmode.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,11 +26,9 @@ Provides a list of constants to configure the CSV parsing/writing operation beha
26
26
27
27
*variable* = `QuotationMode`.*Constant*
28
28
29
-
---
30
-
31
-
## Remarks
32
-
33
-
The `QuotationMode.Critical` value, default one, is used to indicates the CSV file must use escape char only in fields having special char. The `QuotationMode.All` value most be used for those CSV files in wich all its fields will be escaped with the escape char given with the `EscapeChar` property.
29
+
>:pencil:**NOTE:**
30
+
>
31
+
>The `QuotationMode.Critical` value, default one, is used to indicates the CSV file must use escape char only in fields having special char. The `QuotationMode.All` value most be used for those CSV files in wich all its fields will be escaped with the escape char given with the `EscapeChar` property.
Copy file name to clipboardExpand all lines: docs/api/methods/dumptoarray.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,9 @@ The required *OutPutArray* argument is an identifier specifying a dynamic `Strin
25
25
26
26
_None_
27
27
28
-
---
29
-
30
-
## Remarks
31
-
32
-
**Note**: *Before dump data, is recommended to make a `ImportFromCSV` or `ImportFromCSVstring` method call.*
33
-
34
-
The *OutPutArray* parameter must be declared as dynamic `String` array. If user forget to do this, an error will occur.
28
+
>:pencil:**NOTE:**
29
+
>
30
+
>Before dump data, is recommended to make a `ImportFromCSV` or `ImportFromCSVstring` method call. The *OutPutArray* parameter must be declared as dynamic `String` array. If user forget to do this, an error will occur.
Copy file name to clipboardExpand all lines: docs/api/methods/exporttocsv.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,9 @@ The required *csvArray* argument is an identifier specifying a `Variant` array v
25
25
26
26
_None_
27
27
28
-
---
29
-
30
-
## Remarks
31
-
32
-
**Note: Before invoke the `ExportToCSV` method, the user must to open a connection to the CSV file.**
33
-
34
-
The *csvArray* parameter must be declared as `Variant` array. Passing a variable that isn't an array will cause an error and the operation aborts.
28
+
>:pencil:**NOTE:**
29
+
>
30
+
>Before invoke the `ExportToCSV` method, the user must to open a connection to the CSV file. The *csvArray* parameter must be declared as `Variant` array. Passing a variable that isn't an array will cause an error and the operation aborts.
Copy file name to clipboardExpand all lines: docs/api/methods/getdatafromcsv.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,13 +25,9 @@ The required *csvPathAndFilename* argument is an identifier specifying a `String
25
25
26
26
*Type*: `String`
27
27
28
-
---
29
-
30
-
## Remarks
31
-
32
-
The *csvPathAndFilename* parameter must be the full path to the target CSV file, this means, the parameter holds the folder path, the file name and the ".csv" extension.
33
-
34
-
---
28
+
>:pencil:**NOTE:**
29
+
>
30
+
>The *csvPathAndFilename* parameter must be the full path to the target CSV file, this means, the parameter holds the folder path, the file name and the ".csv" extension.
<tdstyle="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
37
+
</tr>
38
+
</tbody>
39
+
</table>
23
40
24
41
### Return value
25
42
26
43
_None_
27
44
28
-
---
29
-
30
-
## Remarks
31
-
32
-
**Note: Before invoke the `ImportFromCSV` method, the user must to open a connection to the CSV file.**
33
-
34
-
If the *HeadersOmission* parameter is set to `True`, the CSV file headers, first record, will be ignored by the parser only when the `StartingRecord` property is set to 1.
45
+
>:pencil:**NOTE:**
46
+
>
47
+
>If the *HeadersOmission* parameter is set to `True`, the CSV file headers, first record, will be ignored by the parser only when the `StartingRecord` property is set to 1.
48
+
>
49
+
>The *PassControlToOS* parameter allows user to pass control to the operating system. Control is returned after the operating system has finished processing the events in its queue.
The `FieldsDelimiter`, `RecordsDelimiter`, `EscapeChar`, `StartingRecord` and `EndingRecord` properties sets the method's behavior to the needs.
58
+
User can set `CommentLineIndicator` for those CSV files having a combination of empties lines, blanks lines or commented ones for parse the file ONLY when the parser is working on `QuotationMode.Critical` mode. In that mode, the cited lines are simply skipped, leaving no empty values between records separated by this kind of lines. In other words, if the CSV file holds a record and then some special lines (blank, empty or commented) and then another record, the second record will be saved contiguous to the first record ignoring the lines between both.
59
+
60
+
>:warning:**CAUTION**
61
+
>
62
+
>Before invoke the `ImportFromCSV` method, the user must to open a connection to the CSV file. If the CSV file has no data, this is the file is an empty one, the `ImportFromCSV` method returns an empty array, that is, an array bounded from 0 to -1 and holding no elements and no data.
44
63
45
64
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)
<tdstyle="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> variable.</td>
41
+
</tr>
38
42
</tbody>
39
43
</table>
40
44
41
45
### Return value
42
46
43
47
_None_
44
48
45
-
---
46
-
47
-
## Remarks
48
-
49
-
If the *HeadersOmission* parameter is set to `True`, the *CSVstring* headers, first record, will be ignored by the parser only when the `StartingRecord` property is set to 1.
49
+
>:pencil:**NOTE:**
50
+
>
51
+
>If the *HeadersOmission* parameter is set to `True`, the CSV file headers, first record, will be ignored by the parser only when the `StartingRecord` property is set to 1.
52
+
>
53
+
>The *PassControlToOS* parameter allows user to pass control to the operating system. Control is returned after the operating system has finished processing the events in its queue.
The `FieldsDelimiter`, `RecordsDelimiter`, `EscapeChar`, `StartingRecord` and `EndingRecord` properties sets the method's behavior to the needs.
62
+
User can set `CommentLineIndicator` for those CSV files having a combination of empties lines, blanks lines or commented ones for parse the file ONLY when the parser is working on `QuotationMode.Critical` mode. In that mode, the cited lines are simply skipped, leaving no empty values between records separated by this kind of lines. In other words, if the CSV file holds a record and then some special lines (blank, empty or commented) and then another record, the second record will be saved contiguous to the first record ignoring the lines between both.
63
+
64
+
>:warning:**CAUTION**
65
+
>
66
+
>If the CSV file has no data, this is the file is an empty one, the `ImportFromCSVstring` method returns an empty array, that is, an array bounded from 0 to -1 and holding no elements and no data.
59
67
60
-
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)
68
+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)
0 commit comments