summaryrefslogtreecommitdiff
path: root/scraper
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-11-25 22:20:29 +0100
committerJules Laplace <julescarbon@gmail.com>2018-11-25 22:20:29 +0100
commit4d0fc39c2a7a2974a3e5402990010dcd3b7bd596 (patch)
tree53a31fe94dd8c9ec1784b2cf323d3885148f0faf /scraper
parente1fa31bfd6a938341c3a8a63f238d0952cf4b429 (diff)
mv
Diffstat (limited to 'scraper')
-rw-r--r--scraper/pdf_dump_first_page.sh19
1 files changed, 19 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..2749915d
--- /dev/null
+++ b/scraper/pdf_dump_first_page.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+for i in datasets/s2/pdf/*/*/*.pdf
+ do
+ OUTPUT="${i%.*}.txt"
+ if [[ ! -e $OUTPUT ]]
+ then
+ pdf2txt.py -p 1 $i > $OUTPUT
+ echo $OUTPUT
+ else
+ if [ -s $OUTPUT ]
+ then
+ echo "found $OUTPUT"
+ else
+ echo "rm empty $OUTPUT"
+ rm -f $OUTPUT
+ fi
+ fi
+ done