Here is a formula solution:

Cell H1
is the delimiter. In this case a space.
Helper:=SUM(C1,LEN(B1)-LEN(SUBSTITUTE(B1,$H$1,"")))+1
You must fill the formula one row more.
E1:=a1
E2:=LOOKUP(ROW(1:1),$C:$C,A:A)&""
F1:=b1
F2:=MID($H$1&LOOKUP(ROW(A1),$C:$C,B:B)&$H$1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),$C:$C,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),$C:$C)))+1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),$C:$C,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),$C:$C)+1))-FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),$C:$C,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),$C:$C)))-1)&""
Cons:
Numbers will be converted to Text.
Of course you can remove the &""
at the end of the formula, but blank cells will be filled with 0.