Where are the text files hosted? Your personal computer? A server somewhere?
This would be very easy to implement. Create a small script in the language of your choice (you've tagged the post as PHP) that makes a call to the Tumblr API. From there examples, you could retrieve a listing of your latest posts with a call like this:
http://api.tumblr.com/v2/blog/YOURBLOG/posts/text?api_key=YOURAPIKEY
The script could then take the latest Post ID and rename replace.txt
. Assuming this is running on a linux server, a simple CRON job would set this to run at any interval you wish (5 minutes? 5 hours? once a day?)