how to extract columns like awk $1 $5

beliavsky at aol.com beliavsky at aol.com
Fri Jan 7 12:38:21 EST 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