Adding string space at beginning or end of cell based on another cell

Hello,

I am trying to use the cellsplitter node to seperate out some input text. There are two columns, one for the text that I’d like to split out (using ‘space’ as the delimieter) and the second column has a flag for the first and last item in the sequence.

I’d like to add an additional space to the beginning of the ‘LAST’ text so that all cells are essentially shifted over once to the right. Simirarily, I’d like to add a space after the first text field in the ‘FIRST’ item.

In the example workflow, I’d like to have the textArr[1] column blank for the ‘FIRST’ text, and textArr[0] blank for the ‘LAST’ text.

Beyond this, my second problem is that I’d like textArr[3] to only have text when there is a RouteX number, and otherwise be blank. This would mean that the single letter text (w in row 0, r in row 4, b in row 6, l in row 10, etc) for all rows would end up in textArr[4].

I hope this makes sense, would really appreciate any help on this issue.

Test_Splitter.knwf