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/api/csvarraylist.md
+77-2Lines changed: 77 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,11 +79,21 @@ Class module developed to emulate some functionalities from the `ArrayList` pres
79
79
<tdstyle="text-align: left;">Creates an empty jagged array. The operation will turns the array <code>ArrVar</code> into an jagged array with <code>ArraySize + 1</code> rows and each row with <code>VectorSize</code> columns. To access to an individual element user must use something like <code>expression(i)(j)</code>, where <code>i</code> denotes an index in the main array and <code>j</code> denotes an index in the child array.</td>
<tdstyle="text-align: left;">Remove duplicates from records. Requires rectangular table input (all records with same fields count).The <code>keys</code> parameter will indicate which fields/columns will be used in the deduplication. A string like "0,5" used as parameter will deduplicate the records over columns 0 and 5. If a string like "1-6" is used as argument, the deduplication will use the 2nd through 7th fields.</td>
<tdstyle="text-align: left;">Main constructor method. Populates the current instance using values passed as a Java array string (<code>{{*};{*}}</code>).</td>
<tdstyle="text-align: left;">Indicates whether the current instance is used to store indexed elements.</td>
105
115
</tr>
106
116
<tr>
107
117
<tdstyle="text-align: left; color:blue;"><em>Inner, Left and Right Join</em></td>
108
118
<tdstyle="text-align: left;">Method</td>
109
-
<tdstyle="text-align: left;">Run a like SQL join on the provided data tables.<br>1) Use a string such as <code>{1-2,5,ID};{1-6}</code> as a predicate of the columns to indicate the join of columns 1 to 2, 5 and ID of leftTable with the columns 1 to 6 of rightTable.<br>2) Use a string such as <code>{*};{1-3}</code> to indicate the union of ALL columns of leftTable with columns 1 to 3 of rightTable.<br>3) The predicate must use the dot syntax <code>[t1.#][t1.fieldName]</code> to indicate the fields of the table, where t1 refers to the leftTable.<br>4) The matchKeys predicate must be given as <code>#/$;#/$</code></td>
119
+
<tdstyle="text-align: left;">Run a like SQL join on the provided data tables.<br>1) Use a string such as <code>{1-2,5,ID};{1-6}</code> as a predicate of the columns to indicate the join of columns 1 to 2, 5 and ID of leftTable with the columns 1 to 6 of rightTable.<br>2) Use a string such as <code>{*};{1-3}</code> to indicate the union of ALL columns of leftTable with columns 1 to 3 of rightTable.<br>3) The predicate must use the dot syntax <code>[t1.#][t1.fieldName]</code> to indicate the fields of the table, where t1 refers to the leftTable.<br>4) The matchKeys predicate must be given as <code>#/$;#/$</code>.</td>
<tdstyle="text-align: left;">Inserts a new field named <code>FieldName</code> into the records of the current instance at the given index. If a formula is provided, the field is populated in each record (row) with the result of evaluating the formula using the fields specified in the formula.</td>
<tdstyle="text-align: left;">Gets or sets an Item, by its index, from the current instance. This is the default property, so the user can use abbreviated expressions such as <code>expression(i)</code> to access the Item <code>i</code>, where <code>expression</code> represents a <code>CSVArrayList</code> object.</td>
@@ -164,11 +184,31 @@ Class module developed to emulate some functionalities from the `ArrayList` pres
164
184
<tdstyle="text-align: left;">Gets all indexed Items from the current instance.</td>
<tdstyle="text-align: left;">Merges the specified fields in the current instance data table. The <code>indexes</code> parameter will indicate which fields/columns will be merged. A string like "2,7" used as parameter will merge the records over the columns with indexes 2 and 7. If a string like "3-8,10" is used as argument, the merge operation will use the 4th to 9th fields and the 11th field.</td>
<tdstyle="text-align: left;">Rearranges the fields of the stored data. A string such as "0-3,5-4,6-11" used as a parameter will leave the position of fields with indexes 0 to 3 unchanged, swap the fields at indexes 5 and 4, and leave all remaining fields in position.</td>
<tdstyle="text-align: left;">Reduces the internal array list to the result by evaluate the <code>ReductionExpression</code> parameter over all items.</td>
@@ -184,6 +224,11 @@ Class module developed to emulate some functionalities from the `ArrayList` pres
184
224
<tdstyle="text-align: left;">Removes the Item at specified Index.</td>
<tdstyle="text-align: left;">Moves a field leftward or rightward. Negative values for the <code>Shift</code> argument will produce leftward shifts.</td>
<tdstyle="text-align: left;">Shrinks the buffer size to avoid extra space reservation.</td>
@@ -214,6 +269,21 @@ Class module developed to emulate some functionalities from the `ArrayList` pres
214
269
<tdstyle="text-align: left;">Sorts the internal Items. Requires all Items to be one-dimensional arrays. If the <code>FromIndex</code> is set to <code>-1</code>, the sorting will start at the Items lower bound; when the <code>ToIndex</code> is set to <code>-1</code>, the operation will end at the Items upper bound. The <code>SortingKeys</code> parameter is used to define the index of the columns on which the sorting operation will be performed, negative values indicate sorting in descending order; the user can pass an array of sorting keys as a parameter. The <code>SortAlgorithm</code> parameter indicates which sort algorithm will be used to perform the sort.</td>
<tdstyle="text-align: left;">Sorts the internal Items by its keys using QuickSort. Requires all Items to be one-dimensional arrays. The indexes are base 0.</td>
<tdstyle="text-align: left;">Serializes the buffer contents to a common string representation. Only one-dimensional arrays and jagged arrays populated with one-dimensional arrays are supported.</td>
<tdstyle="text-align: left;">Turns a two-dimensional array into a jagged array. The method will successively deconstruct and delete the two-dimensional, passing its contents to the specified jagged array array.</td>
<tdstyle="text-align: left;">Optional. Identifier specifying a <code>String</code> Type variable representing the expression used to compute the value for the new field.</td>
41
+
</tr>
38
42
</tbody>
39
43
</table>
40
44
@@ -49,7 +53,7 @@ See also
49
53
50
54
## Behavior
51
55
52
-
The `InsertField` method will insert a new field into all records, if they all have the same number of fields, in the current instance. The value of the `FieldName` parameter will be inserted into the record/first row, otherwise not.
56
+
The `InsertField` method will insert a new field into all records, if they all have the same number of fields, in the current instance. The value of the `FieldName` parameter will be inserted into the record/first row, otherwise not. If a formula is given, the field is populated in each record (row) with the result of evaluating the formula on each field.
53
57
54
58
### ☕Example
55
59
@@ -64,7 +68,8 @@ Sub InsertField()
64
68
EndWith
65
69
WithCSVint
66
70
.ImportFromCSV.parseConfig
67
-
.InsertField.fieldsBound+1,"New field"'Insert a field named "New field"
71
+
.InsertField.fieldsBound+1,"Taxes","FORMAT(Total Revenue * Percent(18);'Currency')")'Insert a field named "Taxes"
0 commit comments