2008/10/21 <[EMAIL PROTECTED]>: > grrr thanks George, thanks Daniel, that's it. Works fine with real > tabs. Now this brings me to a follow-up: I have not prepared the input > ascii file, I just got if for post-processing (23 MB). Now it seems > that I would have to replace all series of spaces in this file with > real tabs at first.. How would you do that? Are there text editors > capable of doing this?
If the file you got isn't really tab delimited, you shouldn't convert it to a tab delimited file before processing. Just process it as it is, a multiple-space-delimited file. f = open('file.txt') for line in f: line = line.strip().split() # do whatever with data print line f.close() Clóvis -- http://mail.python.org/mailman/listinfo/python-list