Skip to content

Commit 9066f0f

Browse files
committed
Docs update
1 parent 6958d45 commit 9066f0f

20 files changed

+154
-18
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ VBA CSV interface is the most complete, and open source, CSV/TSV VBA parser libr
1010
* __Memory-friendly__. CSV/[TSV](https://www.iana.org/assignments/media-types/text/tab-separated-values) files are processed using a custom stream technique, only 0.5MB are in memory at a time.
1111
* __Easy to use__. A few lines of code can do the work!
1212
* __Highly Configurable__. User can configure the parser to work with a wide range of CSV files.
13+
* __CSV data subsetting__. Split CSV data into a set of files with related data.
1314
* __Like SQL queries on CSV files__. Add your own logic to mimic SQL queries and filter data by criteria (=, <>, >=, <=, AND, OR).
1415
* __Automatic delimiter guesser__. Don't worry if you forgot the file configuration!
1516
* __Flexible__. Import only certain range of records from the given file, import fields (columns) by indexes or names, read records in sequential mode.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: CSVdatasetSplit
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 4
6+
---
7+
8+
# CSVdatasetSplit
9+
{: .d-inline-block }
10+
11+
New
12+
{: .label .label-purple }
13+
14+
Splits the CSV data into a set of files in which each piece has a related portion of the data.
15+
{: .fs-6 .fw-300 }
16+
17+
---
18+
19+
## Syntax
20+
21+
*expression*.`CSVdatasetSplit`*(filePath, \[subsetColumn:= 1\], \[headers:= True\])*
22+
23+
### Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th style="text-align: left;">Part</th>
29+
<th style="text-align: left;">Description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr>
34+
<td style="text-align: left;"><em>filePath</em></td>
35+
<td style="text-align: left;">Required. Identifier specifying a <code>String</code> Type variable representing the full path to the target CSV file.</td>
36+
</tr>
37+
<tr>
38+
<td style="text-align: left;"><em>subsetColumn</em></td>
39+
<td style="text-align: left;">Optional. Identifier specifying a <code>Long</code> Type variable representing the index of the field on which the creation of the data groups will take place.</td>
40+
</tr>
41+
<tr>
42+
<td style="text-align: left;"><em>headers</em></td>
43+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable indicating whether the target CSV file has a header record.</td>
44+
</tr>
45+
</tbody>
46+
</table>
47+
48+
### Returns value
49+
50+
*Type*: `Collection` object
51+
52+
---
53+
54+
## Behavior
55+
56+
The `CSVdatasetSplit` method will create a file for each different value (data grouping) in the field at the *subsetColumn* position, then all related data is appended to the respective file. Use the *headers* parameter to include a header record in each new CSV file. When the CSV file has a header record and the user sets the *header* parameter to `False`, the header row is saved in a separate file and the rest of CSV files will have no header record.
57+
58+
>📝**Note**
59+
>{: .text-grey-lt-000 .bg-green-000 }
60+
>The result subsets will be saved in a folder named [\*-subsets], where (\*) denotes the name of the source CSV file.
61+
{: .text-grey-dk-300 .bg-grey-lt-000 }
62+
63+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/dumptoaccesstable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToAccessTable
33
parent: Methods
44
grand_parent: API
5-
nav_order: 4
5+
nav_order: 5
66
---
77

88
# DumpToAccessTable

docs/api/methods/dumptoarray.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToArray
33
parent: Methods
44
grand_parent: API
5-
nav_order: 5
5+
nav_order: 6
66
---
77

88
# DumpToArray

docs/api/methods/dumptojaggedarray.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToJaggedArray
33
parent: Methods
44
grand_parent: API
5-
nav_order: 6
5+
nav_order: 7
66
---
77

88
# DumpToJaggedArray

docs/api/methods/dumptosheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: DumpToSheet
33
parent: Methods
44
grand_parent: API
5-
nav_order: 7
5+
nav_order: 8
66
---
77

88
# DumpToSheet

docs/api/methods/exporttocsv.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ExportToCSV
33
parent: Methods
44
grand_parent: API
5-
nav_order: 8
5+
nav_order: 9
66
---
77

88
# ExportToCSV
@@ -15,7 +15,7 @@ Exports an array's content to a CSV/TSV file.
1515

1616
## Syntax
1717

18-
*expression*.`ExportToCSV`*(csvArray, \[pconfig:= `Nothing`\], \[PassControlToOS:= `True`\])*
18+
*expression*.`ExportToCSV`*(csvArray, \[pconfig:= `Nothing`\], \[PassControlToOS:= `True`\], \[enableDelimiterGuessing:= `True`\])*
1919

2020
### Parameters
2121

@@ -39,6 +39,10 @@ Exports an array's content to a CSV/TSV file.
3939
<td style="text-align: left;"><em>PassControlToOS</em></td>
4040
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
4141
</tr>
42+
<tr>
43+
<td style="text-align: left;"><em>enableDelimiterGuessing</em></td>
44+
<td style="text-align: left;">Optional. Identifier specifying a <code>Boolean</code> Type variable.</td>
45+
</tr>
4246
</tbody>
4347
</table>
4448

@@ -48,7 +52,7 @@ _None_
4852

4953
>📝**Note**
5054
>{: .text-grey-lt-000 .bg-green-000 }
51-
>Passing a variable that isn't an array will cause an error and the operation aborts.
55+
>The *csvArray* parameter can be an `ECPArrayList` or an array variable, passing another type of variable will cause an error.
5256
{: .text-grey-dk-300 .bg-grey-lt-000 }
5357

5458
See also

docs/api/methods/getcsvsubset.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: GetCSVsubset
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 10
6+
---
7+
8+
# GetCSVsubset
9+
{: .d-inline-block }
10+
11+
New
12+
{: .label .label-purple }
13+
14+
Returns a set of records matching the criteria applied to a desired field from a CSV file.
15+
{: .fs-6 .fw-300 }
16+
17+
---
18+
19+
## Syntax
20+
21+
*expression*.`GetCSVsubset`*(filePath, filters, keyIndex, \[configObj:= Nothing\])*
22+
23+
### Parameters
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th style="text-align: left;">Part</th>
29+
<th style="text-align: left;">Description</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr>
34+
<td style="text-align: left;"><em>filePath</em></td>
35+
<td style="text-align: left;">Required. Identifier specifying a <code>String</code> Type variable representing the full path to the target CSV file.</td>
36+
</tr>
37+
<tr>
38+
<td style="text-align: left;"><em>filters</em></td>
39+
<td style="text-align: left;">Required. Identifier specifying a <code>Variant</code> Type variable representing an array containing all the criteria to be applied to the desired field.</td>
40+
</tr>
41+
<tr>
42+
<td style="text-align: left;"><em>keyIndex</em></td>
43+
<td style="text-align: left;">Required. Identifier specifying a <code>Long</code> Type variable representing the index of the field to apply the criteria.</td>
44+
</tr>
45+
<tr>
46+
<td style="text-align: left;"><em>configObj</em></td>
47+
<td style="text-align: left;">Optional. Identifier specifying a <code>parserConfig</code> object variable holding the parser configuration.</td>
48+
</tr>
49+
</tbody>
50+
</table>
51+
52+
### Returns value
53+
54+
*Type*: `ECPArrayList` object
55+
56+
---
57+
58+
## Behavior
59+
60+
The `GetCSVsubset` method will retrieve all records where the field at position *keyIndex* meets all given criteria. If *configObj* is not given, the internal configuration of the current instance will be used.
61+
62+
>⚠️**Caution**
63+
>{: .text-grey-lt-000 .bg-green-000 }
64+
>If the *filters* parameter is not an array, an error will occur.
65+
{: .text-grey-dk-300 .bg-yellow-000 }
66+
67+
[Back to Methods overview](https://ws-garcia.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/getdatafromcsv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: GetDataFromCSV
33
parent: Methods
44
grand_parent: API
5-
nav_order: 9
5+
nav_order: 11
66
---
77

88
# GetDataFromCSV

docs/api/methods/getrecord.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: GetRecord
33
parent: Methods
44
grand_parent: API
5-
nav_order: 11
5+
nav_order: 12
66
---
77

88
# GetRecord

0 commit comments

Comments
 (0)