Sending things to a .txt cannot be easily done, except in sending it to the game's log (via /say, a channel, or similar). You can kind of use the custom POIs to send some data to an XML file, but it's still not that simple, not like if we had a /writetofile command.
I would suggest looking at the mod that sends data to a website, like fluffy.dk's quest journal mod. You can send data out to a website using the game's browser capability. I'm not super familiar with it, but I think it uses a somewhat novel implementation of the browser to interact with the website. If I were trying to write your mod, looking at that existing mod would be where I'd start.
__________________
|