[librecat-dev] non-unique keys in lookup list?

Jason Loeffler j at minorscience.com
Wed Oct 12 20:38:10 CEST 2016


I'm working on CSV to MARC fix and companion lookup file. I'm looking for a
way to iterate over the lookup file rows with non-unique keys and pop the
paired values into an array. Is there a way to work with non-unique keys,
short of handling this in an external db?

*csv*
controfield
777
888
999

*fix (something like this only returns the last row)*
paste('names','controlfield')
lookup(names,'list_700_names.csv')
marc_add('700',ind1,' 1',ind2,' ',a,$.names)

*list.csv*
777,"Solveig"
888,"Patrick"
888,"Nicolas"
888,"Jason"
999,"Brian"

*desired output*
=001  777
=700  1\$aSolveig

=001  888
=700  1\$aPatrick
=700  1\$aNicolas
=700  1\$aJason

=001  999
=700  1\$aBrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uni-bielefeld.de/mailman2/unibi/public/librecat-dev/attachments/20161012/5c661bc4/attachment.html>


More information about the librecat-dev mailing list