I had no idea it could be this compact. Thank you for your help! David Carel Fellinger <carel.fellinger at iae.nl> wrote in news:mailman.1025316799.2919.python-list at python.org: and write it like this: > > g = open('c:/temp/temp1.txt', 'w') > for line in open('c:/temp/temp.txt'): > g.write(line.strip()) > >