summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbibtotxt.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/bibtotxt.sh b/bibtotxt.sh
index ffa9a85..e6de507 100755
--- a/bibtotxt.sh
+++ b/bibtotxt.sh
@@ -23,15 +23,15 @@ WHERE {
roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
| while read r; do
- uri=`echo $r | awk -F , '{print $2}'| sed -e 's/uri(\(.*\))/\1/'`
- reluri=`echo $uri | sed 's/.*\/\([^\/]\)/\1/'`
- title=`echo $r | awk -F , '{print $3}'| sed -e 's/"\(.*\)"/\1/'`
- artdate=`echo $r | awk -F , '{print $4}'| sed -e 's/"\(.*\)"/\1/'`
- stat=`echo $r | awk -F , '{print $5}'| sed -e 's/uri(\(.*\))/\1/' -e 's/.*\/\([^\/]\)/\1/'`
- jtitle=`echo $r | awk -F , '{print $6}'| sed -e 's/"\(.*\)"/\1/'`
- juri=`echo $r | awk -F , '{print $7}'| sed -e 's/"\(.*\)"/\1/'`
- vol=`echo $r | awk -F , '{print $8}'| sed -e 's/"\(.*\)"/\1/'`
- iss=`echo $r | awk -F , '{print $9}'| sed -e 's/"\(.*\)"/\1/'`
+ uri=`echo $r | awk -F , '{print $2}'| sed -e 's/^uri\(//' -e 's/\)$//'`
+ reluri=`echo $uri | sed 's/.*\///'`
+ title=`echo $r | awk -F , '{print $3}'| sed -e 's/^"//' -e 's/"$//'`
+ artdate=`echo $r | awk -F , '{print $4}'| sed -e 's/^"//' -e 's/"$//'`
+ stat=`echo $r | awk -F , '{print $5}'| sed -e 's/^uri\(//' -e 's/^[^\/]*\///' -e 's/\)$//'`
+ jtitle=`echo $r | awk -F , '{print $6}'| sed -e 's/^"//' -e 's/"$//'`
+ juri=`echo $r | awk -F , '{print $7}'| sed -e 's/^"//' -e 's/"$//'`
+ vol=`echo $r | awk -F , '{print $8}'| sed -e 's/^"//' -e 's/"$//'`
+ iss=`echo $r | awk -F , '{print $9}'| sed -e 's/^"//' -e 's/"$//'`
echo "- [${title}](${reluri})"
echo " [[PDF]](${reluri}.pdf) (${artdate})"