en2ris.pl

EndNote is a commercial bibliography package available for Windows and MacOS/OSX. It claims to export RIS data but this doesn't quite work out. In order to transfer existing reference data from EndNote to refdb, you'll have to process your data through this script.

Starting en2ris.pl

Start the script with the following command:

[perl] en2ris.pl [-e dest] [-f enc] [-h] [-l level] [-L logfile] [-o file] [-O file] [-q] [-t enc] [-y path]

Note: Specifying the command interpreter perl on the command line is not necessary if it is in the default location /usr/bin/perl.

The -e option takes either a numeric (0|1|2) or a symbolic (stderr|syslog|file) argument to specify the log destination.

The -f and -t options select the input and output character encoding, respectively. Supported encodings are platform-dependent and can usually be retrieved by running man iconv or man iconv_open. If no encodings are specified, "ISO-8859-1" aka Latin-1 is assumed for both input and output.

The -h displays a brief usage message.

Use the -l option to set the log level to a numeric value between 0 and 7 or to a symbolic value (alert|crit|err|warning|notice|info|debug). If the log destination is "file", the -L option specifies the full path of a custom log file.

The -o and -O options cause med2ris.pl to write the output data into a file. The lowercase -o option will overwrite any existing file of the same name while the uppercase -O option will append the output to an existing file. If none of these options is used, the output will be written to stdout.

The -q option will cause med2ris.pl to skip the configuration file which is mainly useful for debugging purposes.

The -y switch can be used to specify the location of the refdb shared data in case the automatic script configuration is not appropriate on your system.

The input data are read from stdin. The output is sent to stdout unless you use one of the -o and -O options.

The following example shows the usage of en2ris.pl:

~# perl en2ris.pl -f "ISO-8859-1" -t "UTF-8" -o out.ris < endnote.ris

This will convert the EndNote RIS data in endnote.ris and write the output into out.ris, overwriting any existing file with the same name. The input data are assumed to be Latin-1, whereas the output will be Unicode.

Note: You can leave out the "perl" in the above command if your Perl interpreter is in the default location /usr/bin/perl

The en2ris.pl configuration variables

Table 16-9. en2risrc

Variable Default Comment
outfile (none) The default output file name.
outappend t Determines whether output is appended (t) to an existing file or overwrites (f) an existing file.
from_enc ISO-8859-1 The character encoding of the input data
to_enc ISO-8859-1 The character encoding of the output data
logfile /var/log/med2ris.log The full path of a custom log file. This is used only if logdest is set appropriately.
logdest 1 The destination of the log information. 0 = print to stderr; 1 = use the syslog facility; 2 = use a custom logfile. The latter needs a proper setting of logfile.
loglevel 6 The log level up to which messages will be sent. A low setting (0) allows only the most important messages, a high setting (7) allows all messages including debug messages. -1 means nothing will be logged.

en2ris' behind-the-scenes data mangling

en2ris.pl fixes a couple of problems found in RIS data exported from EndNote. The main issues are the incomplete date formats, the export of page ranges into a single "SP" tag line, and the export of keywords as a list into a single "KW" tag line.

en2ris does not validate the input files. That is, the input files must stick to the rules of the data sources, otherwise the conversion results are not predictable.