Сортировка файла с помощью Python

Имеется txt файл с содержанием:

    "STEAM_0:0:82310879"    
    {
        "name"  "123"
        "deny"  
        {
        }
        "allow" 
        {
        }
        "group" "operator"
    }

    "STEAM_0:0:11310879"    
    {
        "name"  "321"
        "deny"  
        {
        }
        "allow" 
        {
        }
        "group" "operator"
    }

Требуется привести его к виду по типу:

    id = "STEAM_0:0:00000000" name = "123" group = "123"

Код, который хотел использовать, но выдает он None:

    def find_steamid (sid):
        fcopy = open('users_copy.html')
        word = str(sid)
        soup = BeautifulSoup (fcopy, 'lxml')
        f = soup.find('h1').find(text = str(word))
        print(f)
        return 
    find_steamid('STEAM_0:0:88310879')

Код номер два, без html:

f = open("users_copy.txt", 'r')
f.readline()
    new = []
    for lines in f:
        if lines == '   "allow"':
            print('1')
        if lines == '   "deny"':
            print('1')
        if lines == '{':
            print('1')
        if lines == '}':
            print('1')
        if lines == '   {':
            print('1')
        if lines == '   }':
            print('1')
        else:
            new.append(lines)
    print(str(new))

    

Ответы (1 шт):

Автор решения: Edward Grachev

Если я правильно тебя понял то вот так

stream_list = []
str_list = []
with open("1.txt", 'r', encoding='utf-8') as file:
     for line in file.readlines():
        if "STEAM" in line:
             stream_list.append(line.strip())
        else:
            line = line.replace('}', '').replace('{', '').strip()
            str_list.append(line)
res = []
new_list = ''.join(str_list).replace('"', ' ').split(' ')
int_list = []
for i in new_list:
    if i.isdigit() is True:
        int_list.append(i)

for i in range(len(stream_list)):
    res.append({'id': stream_list[i], "name": int_list[i], "group": int_list[i]})

print(res)
→ Ссылка