Re: [Refdb-users] Field math advice
Status: Beta
Brought to you by:
mhoenicka
|
From: Damien J. D. <D.J...@cs...> - 2006-06-25 18:59:08
|
Gidday Daniel This may be a bit hacky, it's something I wrote when I first started, working around my own lack of knowledge. It's the script I used once to get arbitrary sql queries out of REFDB using postgresql. I've changed it so that the sql command is close to the one that you'd want. Also you have to enter your database name and you may have to add username and password details if they're not already set up in config files etc. and to use the database client you're using. Peace Damien echo -- start script -- rm -f out.111 rm -f out.222 rm -f out.333 psql DBNAME -t -c "select refdb_citekey from t_refdb where to_number(refdb_startpage,"9999999999") > to_number(refdb_endpage,"9999999999");">out.111 cat out.111 | echo :ID:\>9999 `sed -e 's/ / OR :CK:=/g'` > out.222 refdbc -d djdphd -C getref -t ris `cat out.222` > out.333 cat out.333 echo -- end script -- Daniel O'Donnell wrote: > Hi all, > > A question: > > In adding legacy data to my refdb database, I have inconsistencies in > the way end page numbers are represented: they can show up in any of the > following formats: > > a) 323-324 > b) 323-24 > c) 323-4 > > I think I'd prefer (a), because the others can all be derived from it. > What I'd been thinking of doing was trying to extract the records that > are in the form (b) or (c) and then manually correct them (if somebody > has a better idea, I'd love to hear it). > > To find the ones I wanted, I thought I'd use something like this: > > refdbc: getref :EP:<:SP: > > But this clearly isn't doing what I'm expecting, as here are my first > three results (of hundreds); ideally of these three, only the first > should show up; the second one in the list actually has an EP that is > larger than SP, though it isn't showing up in the output: > > ID*:1 (1992) > Key: ABRAHAM1992 > Abraham,Lenore > Cædmon's Hymn and the Geþwærnysse (fitness) of things > American Benedictine Review 43:331-44 > > ID*:5 (1998) > Key: SZARMACH1998 > Szarmach,Paul E. > Anthem: Auden's Caedmon's Hymn > > in: Utz,Richard J., Shippey,T.A., Workman,Leslie J., University of > Sydney, Centre for Medieval Studies(ed.), Medievalism in the modern > world essays in honour of Leslie J. Workman; part of: Making the Middle > Ages > Series Volume: v. 1pp. 329-340 > > > Any suggestions? > > -d > |