The term HTML Export is effectively a method for exporting marked-up text with HTML being the default mark-up. But you can as easily export text file. If you're exporting via Nakakoji view, then I don't think there is a filename attribute - you supply it when you export. Nakakoji always exports a single file - with the contents depending on the scope of notes you select in the export pane.
If you want to export plain text files, i.e. '.txt', files that you'll need to set the
HTMLExportExtension to 'txt'. also use templates that don't insert HTML. Don't take the 'HTML' part of HTML export too literally.
If none of this makes sense it might help if you explained, simply, for what purpose you want output. By al means offer up a demo TBX of source and an a file simulating the output you want. It's likely to be possible.
If sharing source data is too sensitive to post in the forum, by all means contact me (email button in my forum profile) so you can discuss the problem in a less public context. I'd only ask that if we get a solution, the generalities of the solution can be shared with fellow users (using made-up specimen data).