First, move all the text files out of your library folder. I suggest use a bulk-renamer to rename them to the folder name and then move them somewhere else. (They aren't registered in the Calibre database so it shouldn't cause any issues, as long as you're careful to limit it to the txts.)
Get Action Chains plugin. Make a new chain. Single-field edit on formats, this template (swapping out D:\Whatever\ for your somewhere else):
Code:
D:\Whatever\{title} ({id}).txt
This should detect the files and add them to your books. Test it on one or two to make sure it works as expected first.
EDIT: You
may be able to skip the 'copying them all out and bulk-editing' by repliating the library path with a template. I don't know how to do this.
I don't know what will happen if the file doesn't exist.