Thank you Robin, that works perfectly, and was just what I needed!
Regarding the other issue I had, I managed to solve it myself: I just put an '-inputencoding UTF-8' argument on the textutil command, which seemed to make everything appear properly in the merged document.
Thanks again Robin.
Best wishes, Jamal
- For the command, put the following:
perl -pe 's/##\d+\w? ##/"##".++$n." ##"/eg'
Robin