Is it possible to get malware from .txt files?

Depends on the text editor you use, some of them may have known vulnerabilities that may allow it, but just from opening an txt file with notepad wont do any harm.
For example word allows macros to be used, so you can create an malicious macro and download malware or do something else, pdf can also contain an malicious codes.