That's something that I think many of us would like. I have several files that need to contain the version number, not just the .txt file but also the .cmd that creates the zipfile for uploading, etc. This is how I get around that:
- Have a file Version.lua that contains just one little table with all of this stuff in it.
- Create templates for .txt and .cmd files, for example myaddon.txt.template.
- At publication time, generate the .txt and .cmd files from the templates, taking the variables from Version.lua.