This definitely sounds like a task for a .bsh script; I’m pretty sure there’s not a built-in function that will allow you to mix and match separators.
I don’t know the Marc4j syntax off the top of my head, but here’s a pseudocode representation of what you could do:
field = record.getField(600);
string = “”;
foreach (field.getSubfields as subfield) {
if (subfield.getCode() == ‘d’ && string.length > 0) {
string += “ “;
} else if (string.length > 0) {
string += “--";
}
string += subfield.getText();
}
return string;
I’m pretty sure that all of the operations in that pseudocode are possible (and straightforward) in a .bsh script if you just look up the syntax.
- Demian
From: solrma...@googlegroups.com [mailto:solrma...@googlegroups.com]
On Behalf Of Adam Wead
Sent: Wednesday, October 03, 2012 5:19 PM
To: solrma...@googlegroups.com
Subject: [solrmarc-tech] field separator question
Hi all,
I have a 600 field like this:
a| Lennon, John, d| 1940-1980 x| Assassination
And want subfields a and d to be joined with a space but any subsequent subfields joined with a "--" to look like this:
Lennon, John, 1940-1980--Assassination
I've got some .bsh scripts already doing some customization, but I can't seem to figure out how to solve this particular problem. If anyone can point me to some code sample or documentation that might show how to tackle this particular problem, I'd be very grateful!
Many thanks,
...adam
Adam Wead | Systems and Digital Collections Librarian
ROCK AND ROLL HALL OF FAME + MUSEUM
Library and Archives
--
You received this message because you are subscribed to the Google Groups "solrmarc-tech" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/solrmarc-tech/-/eyxHRxcXnysJ.
To post to this group, send email to solrma...@googlegroups.com.
To unsubscribe from this group, send email to solrmarc-tec...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/solrmarc-tech?hl=en.