Spilt one huge PDF into separate .txt files I have a PDF file of 2 years worth of journal entries that were exported from MacJournal back in 2009. I now use Day One, which allows CLI to import .txt files.

My question is, is it possible to export a PDF of formatted entries (with date) into individual .txt files of each entry separated (with the file name of month/Day/Year.txt)?
Try to first use pdftotext or ebook-convert to convert the PDF to text:

brew install poppler;pdftotext file.pdf

/Applications/calibre.app/Contents/MacOS/ebook-convert file.pdf file.txt


Then if for example the text file has a format like this:

2012-12-31
paragraph 1
paragraph 2

2013-01-01
paragraph 1
paragraph 2


Try running a command like this:

awk -v RS= -F'\n' '{print $0&gt;($1".txt")}' file.txt


Or if the text file has a format like this:

2012-12-31

paragraph 1

paragraph 2


2013-01-01

paragraph 1

paragraph 2


Try running a command like this:

ruby -e '$&lt;.read.split("\n\n\n").each{|s|title,content=s.split("\n\n",2)
File.open(title+".txt","w"){|f|f.puts content}}' input.txt