scholarref

tools for DOI and BiBTeX reference extraction, fetching, and parsing
git clone git://src.adamsgaard.dk/scholarref
Log | Files | Refs | README | LICENSE

commit 84b1126dd48d57e3a1f525f19f3d1654b27dcf3c
parent 98931f5cbad0439d1908cd8a979f0af5cd6ac115
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Tue, 19 Nov 2019 10:19:45 +0100

Improve doi detection in pdf files

Diffstat:
Mgetdoi | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/getdoi b/getdoi @@ -64,9 +64,9 @@ get_doi_from_crossref() { } get_doi_from_file() { - doi=$(pdfinfo "$1" | grep -io "doi.*") || - doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi.*" -m 1 ) || - die "Error: Could not extract DOI from file $doi" + doi=$(pdfinfo "$1" | grep -io "doi.*" -m 1) || + doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi.*" -m 1) || + die "Error: Could not extract DOI from file $1" doi=$(echo "$doi" | sed 's/[A-Za-z\.\/:]*//;s/[\.,]$//' |\ sed 's/.*\(10\.\)/\1/' | cut -d' ' -f1 | sed 's/,//g') echo "$doi"