RITA showed, Glenn's solution is honourable second, while Rob's suggestion only penultimate far behind ;)
The details: I tested only with one log file of 161'000 lines. RITA revealed that most of the time is lost (or spent ?) in rearranging the records for later advantageous use. Instead of inserting a tag to many lines I now tag _all_ and remove where appropriate, Substr is so much faster than Insert. While this preparation takes seconds, swapping of about 600 records is a matter of milliseconds not worth to shorten. But it's hobby and hours are worth a new insight. Glenns solution: 171 ms, with Pick 85 ms, Rob's suggestion: 69 ms. Ciao.....Mike -- www.Ok.de - die kostenlose E-Mail Adresse
