diff options
Diffstat (limited to 'scraper/pdf_dump_first_page.sh')
| -rw-r--r-- | scraper/pdf_dump_first_page.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scraper/pdf_dump_first_page.sh b/scraper/pdf_dump_first_page.sh new file mode 100644 index 00000000..6277d40c --- /dev/null +++ b/scraper/pdf_dump_first_page.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +for i in datasets/s2/pdf/*/*/*.pdf + do + OUTPUT="${i%.*}.txt" + if [[ ! -e $OUTPUT ]] + then + pdf2txt.py -p 1 $i > $OUTPUT + if [ -s $OUTPUT ] + then + echo "found $OUTPUT" + else + echo "rm empty $OUTPUT" + rm -f $OUTPUT + fi + else + if [ -s $OUTPUT ] + then + echo "found $OUTPUT" + else + echo "rm empty $OUTPUT" + rm -f $OUTPUT + fi + fi + done |
