how to extract columns like awk $1 $5

beliavsky at beliavsky at
Fri Jan 7 18:38:21 CET 2005

It takes a few more lines in Python, but you can do something like

for text in open("file.txt","r"):
words = text.split()
print words[4],words[5]
(assuming that awk starts counting from zero -- I forget).

More information about the Python-list mailing list