On Fri, 10 Jul 2009, [email protected] wrote:
> I need to strip the first part (username) from an email string so that
> only that part will be kept in the MARC. Is there an appropriate
> function/combination of functions for that purpose that I could use in
> a bibconvert template file?
>
> ie. for a user: [email protected], I would like to end up with:
> <datafield tag="999" ind1=" " ind2=" "><subfield  
> code="a">xxx</subfield></datafield>

One way to achieve this is to enchain REP (to replace @ by a space) and
WORDS (to limit to 1 word only) functions on your input, see:
<http://invenio-demo.cern.ch/help/admin/bibconvert-admin-guide#REP>
<http://invenio-demo.cern.ch/help/admin/bibconvert-admin-guide#WORDS>

So you'd create a template that would go like:

  999a::REP(EOL,)---<datafield tag="999" ind1=" " ind2=" "> <subfield
  code="a"><:SuE::SuE::REP(@, )::WORDS(1,R):></subfield></datafield>

This seems to work fine in my tests.  Note that I have used
``WORDS(1,R)'' which may appear to be somewhat counter-intuitive, since
we want to get stuff from the left; you should read it as ``keep 1 word
only and trim everything on its Right''.

(It looks like the behaviour of L and R got somewhat mixed in previous
CDS Invenio releases with respect to LIM/LIMW and WORDS functions; I'll
update the docs and provide some test cases.)

Best regards
-- 
Tibor Simko ** CERN Document Server ** <http://cds.cern.ch/>

Reply via email to