diff options
author | Nick White <git@njw.me.uk> | 2010-09-14 14:13:30 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2010-09-14 14:13:30 +0100 |
commit | 049137943c22098b208a8ef977afcf8d716d2796 (patch) | |
tree | 477ca60a68c78de9c7049d423b52339761cda8c8 | |
parent | b0cc783f8545c563a246adee51a99ff6bfcdfd50 (diff) | |
download | njw-website-049137943c22098b208a8ef977afcf8d716d2796.tar.bz2 njw-website-049137943c22098b208a8ef977afcf8d716d2796.zip |
Simplified and corrected sed commands
-rwxr-xr-x | bibtotxt.sh | 18 |
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})" |