I recommend starting with the python tutorial - it won't take that long.
Anyway, hopefully, this should give you some ideas how to proceed.
By no means is this a working solution, nor does it do any error checking, but it should guide you to the parts of python to learn.
I'm using a dictionary to count the numbers of each column (I've done only column3 here).
# open the file
col3_counts = {}
txtfile = open('txtfile', 'r')
# reading 2 types of data from the file: the 'nodes' and the 'coordinates'
end_of_nodes = False
# read each line from the file
for line in txtfile:
if line.startswith('*NODE'):
end_of_nodes = True
if not end_of_nodes:
# read the node column
cols = line.split() # cols[0] = eid, cols[1] = pid, ....
# get the value of column3
col3 = cols[4]
if col3 not in col3_counts:
col3_counts[col3] = 0
else:
col3_counts[col3] += 1
else:
# now read the coordinates using .split()
# ...
# determine those in column 3 with a count > 2
for num, count in col3_counts.items():
if count > 2:
# do something here
Hope this helps.