The methods presented below can be used to merge and combine lists or to replace list items. The goal is to work with several lists and their matching. See Filter lists to learn about extracting specific items from a list.
Merge data streams (Merge)
The component Merge
Merge (Merge)
Inputs Data 1 (D1) Data stream 1 Data 2 (D2) Data stream 2 Outputs Result (R) Result of merge
Choose items by selecting each index individually (Pick’n’Choose)
The component Pick'n'Choose
Pick'n'Choose (P'n'C)
Inputs Pattern (P) Pick pattern of input indices Stream 0 (0) Input stream 0 Stream 1 (1) Input stream 1 Outputs Result (R) Picked result
Choose items with a given pattern (Weave)
The component Weave
Weave (Weave)
Inputs Pattern (P) Weave pattern of input indices Stream 0 (0) Input stream 0 Stream 1 (1) Input stream 1 Outputs Weave (W) Weave result
Once all items in a list are used up, data items are still added to the output if there are items left in other lists. This way, the desired pattern may be violated towards the end. To avoid this, null-items can be added by right-clicking the component and selecting Insert Nulls.
Fill the index of null-items with other items (Combine Data)
If a list contains any null-items, the component Combine Data
Combine Data (Combine)
Inputs Input 0 (0) Data to combine Input 1 (1) Data to combine Outputs Result (R) Resulting data with as few nulls as possible Index (I) Index of input that was copied into result
Replace null-items with other items (Replace Nulls)
The component Replace Nulls
Replace Nulls (NullRep)
Inputs Items (I) Items to test for null Replacements (R) Items to replace nulls with Outputs Items (I) List without any nulls Count (N) Number of items replaced
Replace items in a list (Replace)
The component Replace Items
Replace Items (Replace)
Inputs List (L) List to modify Item (I) Items to replace with. If no items are supplied, nulls will be inserted. Indices (i) Replacement index for each item Wrap (W) If true, indices will be wrapped Outputs List (L) List with replaced values
Add elements to a list (Insert Items)
The component Insert Items
Insert Items (Ins)
Inputs List (L) List to modify Item (I) Items to insert. If no items are supplied, nulls will be inserted. Indices (i) Insertion index for each item Wrap (W) If true, indices will be wrapped Outputs List (L) List with inserted values
Interconnect items (Cross Reference)
The component Cross Reference
Cross Reference (CrossRef)
Inputs List (A) (A) List (A) to operate on List (B) (B) List (B) to operate on Outputs List (A) (A) Adjusted list (A) List (B) (B) Adjusted list (B)
Equalize the length of lists (Longest List, Shortest List)
The component Longest List
Longest List (Long)
Inputs List (A) (A) List (A) to operate on List (B) (B) List (B) to operate on Outputs List (A) (A) Adjusted list (A) List (B) (B) Adjusted list (B)
If the longer list should be shortened to match the shorter list, then Shortest List
Shortest List (Short)
Inputs List (A) (A) List (A) to operate on List (B) (B) List (B) to operate on Outputs List (A) (A) Adjusted list (A) List (B) (B) Adjusted list (B)
Merge lists by considering their values
The components introduced so far operate on list items independent of their values. In the ribbon tab Sets there is a subgroup Sets which contains several components that operate with lists but regard the items' values. This is only possible for Primitive Data Types, which are texts, numbers and data that can be cast in string format (like points and vectors).
The component Set Union
Set Union (SUnion)
Inputs Set A (A) Data for set Union. Set B (B) Data for set Union. Outputs Union (U) The Set Union of A and B.
Other components work similarly, like Set Difference (S)
Set Difference (S) (ExDiff)
Inputs Set A (A) First set for symmetric difference. Set B (B) Second set for symmetric difference. Outputs ExDifference (X) The symmetric difference between A and B.
Set Intersection (Intersection)
Inputs Set A (A) Data for set Intersection Set B (B) Data for set Intersection Outputs Union (U) The Set Union of all input sets
Combine lists into one item
For Primitive Data Types (see above) it’s possible to combine their values
into a single string with the component Concatenate
Concatenate (Concat)
Inputs Fragment A (A) First text fragment Fragment B (B) Second text fragment Outputs Result (R) Resulting text consisting of all the fragments
The component Text Join
Text Join (Join)
Inputs Text (T) Text fragments to join. Join (J) Fragment separator. Outputs Result (R) Resulting text
These methods, and other components in Sets > Text, can be quite helpful to convert data to a text format that can then be exported to other programs.