EPrints Technical Mailing List Archive

Message: #03043


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Retrieving arrays for export


On 19/05/14 14:37, Andrew Beeken wrote:
Hello!

Okay, so I’m writing a new export template at the moment. Basic CSV
output, but I want to extract some data that seems to be stored in
arrays – namely, ISBN. So, when I extract the ISBN in my export
template I get the following: ARRAY(some_hex), where some_hex
actually changes every time the output is regenerated. I’ve tried
outputting the value with a join command to pipe delimit the data but
it doesn’t do anything to the output – any ides?


## Not sure the $eprint->get call.... but you know that bit already
if ('ARRAY' eq ref $eprint->get($field) ) {
  $value = join ', ', @{ $eprint->get($field) }; # get the list
  $value = q{"} . $value . {"}                   # quote 'cos of commas
} else {
  $value = $eprint->get($field)                  # string is unchanged
}

.... or something similar

--

Ian Stuart.
Developer: ORI, RJ-Broker, and OpenDepot.org
Bibliographics and Multimedia Service Delivery team,
EDINA,
The University of Edinburgh.

http://edina.ac.uk/

This email was sent via the University of Edinburgh.

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.