summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-09-14 14:13:30 +0100
committerNick White <git@njw.me.uk>2010-09-14 14:13:30 +0100
commit049137943c22098b208a8ef977afcf8d716d2796 (patch)
tree477ca60a68c78de9c7049d423b52339761cda8c8
parentb0cc783f8545c563a246adee51a99ff6bfcdfd50 (diff)
downloadnjw-website-049137943c22098b208a8ef977afcf8d716d2796.tar.bz2
njw-website-049137943c22098b208a8ef977afcf8d716d2796.zip
Simplified and corrected sed commands
-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})"