Well, that went faster than I expected. Since you were only moving the \thes field, it's actually fairly easy. (Some such modifications sometimes move all sorts of stuff around.)
This solution does assume there is only one \thes field. If you have more, let me know. It's a bit more complex, but not too difficult.
Here is the basic table, with comments.
c Move the \thes field to the top of the record
group(Main)
c wait for the beginning of a record
'\lx ' > store(Start) dup c capture the first fields
'\thes ' > endstore c stop storing the first fields
dup c don't lose the marker
use(NextField) c wait for the \thes data to go out
group(NextField)
c The next backslash is the end of the \thes field
c since storing was stopped, the data has gone out
'\' > out(Start) c output the first fields
dup back(1) c send the backslash to Main
use(Main) c data following \thes will go out
If you have any questions about how it works, I'll be glad to answer.
I was going to tell you how to add the database type to the file, but the explanation seemed to complicate things, even though it's fairly simple to do.
Karen
Toolbox Support