# Emacs org export shell script from txt file

I have a .txt file which is an org file but not with the .org file extension.

I want to export the file to html on the command line, but it does not work if the file extension is .txt, only if the file extension is .org.

\$ emacs alspac_data_guide.txt --batch -f org-html-export-to-html --kill

Symbol’s function definition is void: org-html-export-to-html


I think this might be because it is not loading in org-mode? How do I modify the shell command to work correctly?

• --batch implies -q so it does not load your init file: you have to load it (or, better, a small subset of it) with -l. All you should nee is to set the load-path and (require 'org). – NickD Jul 13 at 12:45

Type -*- mode:org -*- at the top of file