How to convert to pdf from text file?

I created a text file using markdown-table-editor, including some tables. How would I turn this into a pdf? I tried using markdown-pdf, and it told me the extension type needed to be .mkd or something similar. Obviously, just changing it to that didn’t do anything (well, it did, but the pdf didn’t have a single newline or tab). Whenever I try to open the txt in google docs or mousepad, the formatting gets wrecked. It shows fine in other editors, such as vim, vscode, and even using the cat command in terminal. How can I make this a pdf?

the extension type needed to be .mkd or something similar.

Correct. The markdown file extension must be *.md and not *.txt. And you might later explore *.Rmd.

I use markdown-preview-enhanced package which previews your markdown. Then right click on the preview window to see PDF print options. If you install pandoc on your $PATH you can also add yaml to front of your markdown and in the preview window select Pandoc custom. Pandoc provides further options such as PDF slideshows (beamer) and HTML slideshows (reveal.js).