From 049137943c22098b208a8ef977afcf8d716d2796 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 14 Sep 2010 14:13:30 +0100 Subject: Simplified and corrected sed commands --- bibtotxt.sh | 18 +++++++++--------- 1 file 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})" -- cgit v1.2.3