Create Ebook (epub) From Text File
This is how I make ebooks (*.epub) from plain txt files.
I wanted to read a rather lengthy text with my smartphone - but the orignal source sucked and had no mobile version of the text. So I thought why not create an ebook which is perfect to read on a smartphone.
Here is how I did it (on Windows):
- install Calibre: http://calibre-ebook.com/download_windows
- use ebook-convert.exe to create the epub files
If there is more than one text file, a batch would be great. The following batch will make an epub file from every txt file in that directory:
cd c:\users\johndoe\desktop\epub-cr for /f %%a in ('dir /b *.txt') do "C:\Program Files (x86)\Calibre2\ebook-convert.exe" %%a %%~na.epub
What it does:
- cd into the directory which holds all the txt files
- iterate in a loop over every txt file (
dir /b *.txt), store the filename in the variable
- execute Calibre's convert program with the source (e.g.
- strip the file extension from
%a (%%~na)and add
.epubas the new extension
- if the txt file was named
xyz.epubwill be created
Now you can open the epub files with your favorite ebook reader and start reading with comfort