Hi everybody
There is a faster and more concice method. I first do it step by step.
1) Split before every occurence of "db" :
Split[lst, #2 =!= db &]
{{db, st1, 3, 333.33, 4, 543, 11, 323, de}, {db, st2, 9, 987, 8, 778,
de}}
2) Remove the "db" and "de" in each sublists :
#[[2 ;; -2]] & /@ %
{{st1, 3, 333.33, 4, 543, 11, 323}, {st2, 9, 987, 8, 778}}
3) Rearrange each sublists :
% /. {s_Symbol,
n__?NumericQ} :> (Prepend[#, s] & /@ Partition[{n}, 2])
{{{st1, 3, 333.33}, {st1, 4, 543}, {st1, 11, 323}}, {{st2, 9,
987}, {st2, 8, 778}}}
4) Flatten at level 1 for the result
Flatten[%, 1]
{{st1, 3, 333.33}, {st1, 4, 543}, {st1, 11, 323}, {st2, 9, 987}, {st2,
8, 778}}
All in one :
Flatten[(#[[2 ;; -2]] & /@ Split[lst, #2 =!= db &]) /. {s_Symbol,
n__?NumericQ} :> (Prepend[#, s] & /@ Partition[{n}, 2]), 1]
Regards