Help! I need to go through a text file, and for all lines similar to this: X-Mozilla-Status: 0009 .. I need to unset the 4th bit (so the above becomes 0001). Not all X-Mozilla-Status: lines which have the bit set have status 0009, however. I have 0008, 000b, 0018, and so on. Suggestions? Background: Somehow I managed to delete a load of email in Thunderbird which I need. It ended up in Trash so I moved it back to my Inbox, but for some reason it didn't appear in my Inbox, but did get deleted out of Trash. However by "deleted" I mean it set the 4th bit of the status word, so until I compact the folder I can recover it by unsetting that bit. I still need to work out why it didn't go back into my Inbox, I think I may have discovered a bug there. -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) @ 13 Clarke Rd, Milton Keynes, MK1 1LG