* Multiple Input with Single Input Apps
Posted on December 24th, 2008 by John. Filed under programming.
The few eBook formating tools I’ve posted all share one major flaw. They can only handle a single file as input. This is a problem when you want to run it on all or a number of different eBooks. If you are able to use Bash there is a simple way to run any single input command with multiple items.
This first method gets input from a single directory. This method will not go into subdirectories for input.
$ cd ~/Books/author $ ls -1 *.txt | while read file; do echo $file; ./fix_paragraphs_ebook_txt "$file"; ./remove_extra_whitespace_ebook_txt "$file"; done
This second method gets all files matching the given pattern and will handle subdirectories.
$ find ~/books/ -iname "*.txt" | while read file; do echo "$file"; dos2unix -ad "$file"; ./fix_end_ebook_txt "$file"; done
Tags
amazon
apnx
bash
book
c++
calibre
cybook
device interfaces
ebook
epub
eReader
fb2
formatting
FT
future
gadgets
get books
GUI
heuristic
image
json
KDocker
kindle
Linux
markdown
mobi
nook
palmdoc
pdb
pdf
pml
pmlz
print
pyqt
python
qt
rb
release
Sigil
store
tcr
tips
txt
txtz
ztxt
Archives
- January 2012 (3)
- December 2011 (2)
- November 2011 (1)
- October 2011 (3)
- September 2011 (9)
- August 2011 (15)
- July 2011 (5)
- June 2011 (3)
- May 2011 (4)
- April 2011 (2)
- March 2011 (2)
- February 2011 (4)
- January 2011 (4)
- December 2010 (2)
- November 2010 (1)
- October 2010 (1)
- August 2010 (3)
- July 2010 (4)
- June 2010 (1)
- May 2010 (2)
- March 2010 (1)
- January 2010 (8)
- December 2009 (5)
- November 2009 (6)
- October 2009 (4)
- September 2009 (2)
- August 2009 (6)
- July 2009 (6)
- June 2009 (4)
- May 2009 (6)
- April 2009 (4)
- March 2009 (2)
- February 2009 (4)
- January 2009 (4)
- December 2008 (7)
- November 2008 (2)