Hey, Richard... just to let you know... I can normally beat most looping functions by using a Tally table... but not this one (least ways, not so far ). Your looping function is about 2 seconds faster that my Tally table solution on a 100,000 row test table. Nice job!
FYI... the direct fixed width solution I posted smokes both the Tally table and the looping inside the function by a full 10 out of 13 seconds.
--Jeff Moden
Change is inevitable... Change for the better is not.