file = open('test.txt') for line in file: fields = line.strip().split() print fields[0], fields[1], fields[2], fields[3]