How do you create a subcircuit in LTspice which is in a txt file?
LTspice doesn't care about extensions. Whether the file is a .sub, or .lib, .cir, .txt, or even without extension, it reads the file and if the syntax inside is correct, it will use that file.
Therefore, if your .txt file is already a subcircuit, all you need to do is to add a relevant .lib line inside your schematic, while making sure that you spell the filename properly, say .lib /path/to/some/subcircuit.txt (as you probably know, Windows has a history of hiding extensions, unless manually set otherwise).
If all you need is one subcircuit out of that .txt file, the .lib command ensures that everything inside the file is available in the schematic (as long as everything obeys the syntax). Then simply use the name of the desired .subckt in a symbol of your choice (or a SPICE directive).