On Feb 14, 6:54 am, "W. Watson" <[EMAIL PROTECTED]> wrote: > See Subject. It's a simple txt file, each line is a Python stmt, but I need > up to four digits added to each line with a space between the number field > and the text. Perhaps someone has already done this or there's a source on > the web for it. I'm not yet into files with Python. A sudden need has burst > upon me. I'm using Win XP.
Not sure if "Python program/tool" means "a tool or a program in Python", but if awk is okay, that's the tool I would use: awk '{printf( "%4d %s\n", NR % 10000, $0 )}' -- http://mail.python.org/mailman/listinfo/python-list