Here is the way I solved this after a search. Note that this is not ideal because it only works for a fixed size file. This could be parameterized, but there is likely a way to make it work for a variable sized file without needing the sizes entered as parameters. Also, I scrambled the data a bit to more closely resemble the actual problem.
This is a simplified rendition of my .yaml file. I read this in as text without delimiters.
A:
a: 2
b: 1
c: 6
B:
a: 5
b: 4
c: 3
By using the Find & Replace (I used four steps)
,A
a,2
b,1
c,6
,B
a,5
b,4
c,3
Split Column by Delimiter (a comma here)
Column1 | Column2
-------------------
null | A
a | 2
b | 1
c | 6
null | B
a | 5
b | 4
c | 3
Added Index and Inserted Modulo 4 column(operates on Column3 to create Column4)
Column1 | Column2 | Column3 | Column4
-------------------------------------------
null | A | 0 | 0
a | 2 | 1 | 1
b | 1 | 2 | 2
c | 6 | 3 | 3
null | B | 4 | 0
a | 5 | 5 | 1
b | 4 | 6 | 2
c | 3 | 7 | 3
Sorted Rows by Column4, added another index, and added a modulo 2 column.
Column1 | Column2 | Column3 | Column4 | Column5 | Column6
-------------------------------------------------------------------
null | A | 0 | 0 | 0 | 0
null | B | 4 | 0 | 1 | 1
a | 2 | 1 | 1 | 2 | 0
a | 5 | 5 | 1 | 3 | 1
b | 1 | 2 | 2 | 4 | 0
b | 4 | 6 | 2 | 5 | 1
c | 6 | 3 | 3 | 6 | 0
c | 3 | 7 | 3 | 7 | 1
Sort on Column6 to get groupings of rows that will go into a single column, with the column number in Column6
Column1 | Column2 | Column3 | Column4 | Column5 | Column6
-------------------------------------------------------------------
null | A | 0 | 0 | 0 | 0
a | 2 | 1 | 1 | 2 | 0
b | 1 | 2 | 2 | 4 | 0
c | 6 | 3 | 3 | 6 | 0
null | B | 4 | 0 | 1 | 1
a | 5 | 5 | 1 | 3 | 1
b | 4 | 6 | 2 | 5 | 1
c | 3 | 7 | 3 | 7 | 1
Pivot on Column6 with Values coming from Column2
Column1 | Column3 | Column4 | Column5 | 0 | 1
-----------------------------------------------------------------
null | 0 | 0 | 0 | A | null
null | 4 | 0 | 1 | null | B
a | 1 | 1 | 2 | 2 | null
a | 5 | 1 | 3 | null | 5
b | 2 | 2 | 4 | 1 | null
b | 6 | 2 | 5 | null | 4
c | 3 | 3 | 6 | 6 | null
c | 7 | 3 | 7 | null | 3
Fill up (Column) 1
Column1 | Column3 | Column4 | Column5 | 0 | 1
-----------------------------------------------------------------
null | 0 | 0 | 0 | A | B
null | 4 | 0 | 1 | null | B
a | 1 | 1 | 2 | 2 | 5
a | 5 | 1 | 3 | null | 5
b | 2 | 2 | 4 | 1 | 4
b | 6 | 2 | 5 | null | 4
c | 3 | 3 | 6 | 6 | 3
c | 7 | 3 | 7 | null | 3
Filter (Column) 0 on null and remove Column3, Column4, and Column5 to get the final result
Column1 | 0 | 1
-----------------------------
null | A | B
a | 2 | 5
b | 1 | 4
c | 6 | 3
Table.FirstN,Table.LastN,Table.Range, andTable.Skip. Then you can merge (UI label for joining) withTable.Join, based on a join column of your [Column1].Table.Columnto convert to aList. Expand the list with a delimiter separation. Split the expanded list to the new columns. Delete the unneeded columns.