You should be able to do it with the calibre editor. You can create a regex-functions. One of the parameters the file name where the match is found. A really dumb function to do this is:
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):
return match.group(0) + '<h2>' + file_name + '</h2>'
With this, using the search term:
Gave me:
Code:
<body><h2>OEBPS/Text/Section0001.xhtml</h2>
Which is the full path for the file. The function is written in Python, so you can do whatever you want with it. But, you could use the above to get the file name into each file, and then use other searches-and-replaces to arrange things the way you want.
And for the record, I have another function called "Number Chapter" which can be used to number chapters across the complete book in one go. I don't remember if it a supplied function, or one mentioned in the forum that I copied.