Sounds "import fileinput-ish" to me. Are there fixes to fileinput that will make it applicable to your problems? -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook