You can use the csv module :
http://docs.python.org/library/csv.html
or, as your case is simple, do it yourself :
f=open('myfile.txt','r') # Opens the file read only
d={} # Dict to store result
for line in f: # For each line of the file
sline=line.rstrip('\n').split(" | ") # split the line according to separators used in your file (here " | ")
if len(sline)>1: # we don't want to process empty lines
sline.sort() # to have the same order for all records (avoid double testine)
key=tuple(sline) # Dictionary keys can't be lists
try:
d[key]+=1 # Add one
except KeyError: # If the key doesn't exists yet, count is 1
d[key]=1
print d
f.close()