This is about the best I can do by way of providing a SSCCE: 1) files: a) title files (one title per file): title-001.tex title-002.tex ... title-999.tex b) catchfile index (one file of a thousand lines; a thousand titles is about three or four times the number needed): \CatchFileDef{\zerozerozero}{title-000.tex}{} \CatchFileDef{\zerozeroone}{title-001.tex}{} ... \CatchFileDef{\nineninenine}{title-999.tex}{} c) document files (several categories, having same title): article-001.tex article-002.tex ... article-003.tex abstract-001.tex abstract-002.tex ... abstract-003.tex catalogue-001.tex catalogue-002.tex ... catalogue-003.tex 2) In the head of each document file is a placeholder for the English representation of the serial number of the title: "\zerozerozero". If the placeholder is not useful, I can delete it. 3) In the head of each document file is the serial number of the title, in Arabic representation: "No. 345". 4) The serial number of the title appears also in the filename of the document file: "article-345". 5) The objective is to write in the document file the English representation of the serial number of the title: "\threefourfive". 6) Once the English representations are in place, I can use Perl to make necessary adjustments.