Как сделать выборку строк из одного txt файла и записать в другой txt на Python?
Как-то так
import re

def read_file():
    with open('1.txt','r') as file:
        for line in file:
            f = re.findall(r"^(\w+?)\s", line)
            if f:
                yield ''.join(f)


def main():
    with open('2.txt','w') as file:
        for i in read_file():
            print(i, file=file)               

if __name__ == "__main__":
    main()

Либо так:
from re import findall
open('2.txt', 'w').write('\n'.join([''.join(findall(r"^(\w+?)\s", line)) for line in open('1.txt').read().split('\n') if findall(r"^(\w+?)\s", line)]))
Либо так:
from re import findall
list_=[]
for line in open('1.txt').read().split('\n'):
    symbols = findall(r"^(\w+?)\s", line)
    list_.append(''.join(symbols)) if symbols else None
open('2.txt', 'w').write('\n'.join(list_))