Hi feherke, and thanks.
I still have some problem. I get the 1000 files duplicated with "material" changed to its filenames. But I don't want to duplicate these 1000 files, I only want to duplicate one file, the "scene.rib", 1000 times. And each one of the 1000 duplications of "scene.rib" must have changed "material" by one filenames of the 1000 files.