I'm not sure I understand what you're trying to do, but maybe this will be helpfule:
with open("fin.txt", "r") as file:
text = file.readlines()
line_list = []
for line in text:
letter_list = []
for letter in line.lower():
if letter.isalpha():
letter_list.append(letter)
if len(letter_list) != 0:
words = []
for x in range(0, len(letter_list), 6):
word = letter_list[x: x + 6]
words.append(word)
line_list.append(words)
groups = ["ab", "cd", "ef", "gh", "ij", "kl"]
gr = {}
for la in line_list:
for word in la:
word.sort()
counter = ""
for group in groups:
count = word.count(group[0])+ word.count(group[1])
if count != 0:
counter += str(count)
gr["".join(word)]= "".join(sorted(counter, reverse=True))
for word, count in gr.items():
print(word, count)