Tried out your sub on the OP's data, Leith and I got:
Tom
george
hhh
Dick
1
ajjas
Harry
5
jkajd
But the OP wanted it as:
Tom
Dick
Harry
george
1
5
hhh
ajjas
jkajd
How could your sub be amended to provide the OP's result? Thanks.
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--