Main Page/Endnote

From phurvitz
< Main Page
Revision as of 06:49, 29 October 2007 by Phil Hurvitz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Fixing abbreviated journal names

Some of my references had the full journal name and others had abbreviations. This causes problems when you need a bibliography in a specific format, e.g., with full names you will get the abbreviations for those that do not have full names in the reference; e.g., if you want abbreviations, EndNote will ignore the term lists for those that are stored with abbreviated names.

I got a copy of term lists from the University of Queensland.

To update the term list in Endnote

  1. Open the library.
  2. Click on Tools on the menu bar and choose Define Term Lists
  3. Highlight Journals
  4. Select all journals.
  5. Delete (right-click/Cut). Do not remove the term list altogehter; there does not seem to be a way to add the journals term list back with all the fields in EndNote 7, contrary to the documentation.
  6. Click on the Import List button.
  7. Select the text file to be imported and click on the Open button (I used the Medical, Biosciences, and Chemistry lists).

To fix the list (deprecated, as there is no standard for which abbreviation has the dots)

  1. Export the term list (click the Export List button). I saved this as pmh_phd_journals_term.txt.
  2. Separate the list into columns, one for the full title, and one each for the abbreviated titles.
    cut -f1 pmh_phd_journals_term.txt > full.txt
    cut -f2 pmh_phd_journals_term.txt > abb1.txt
    cut -f3 pmh_phd_journals_term.txt  | sed "s/\./\\./g" > abb2.txt
  3. Join the columns back together with some sed to pre-format the sed scripts for the master edit process:

A perl script for creating a sed script to fix the term list

also creates a standardized term list

#! /usr/bin/perl -w
use warnings;
#local $/=undef;

# read the sed scripts to fix the endnote library

# open the xml library and read it all in
open (LIBRARY, "<pmh_phd.xml") or die "cannot open";
my $lines = <LIBRARY>;
close (LIBRARY);
# remove the header and trailer stuff
$lines =~ s/<XML><RECORDS>//;
$lines =~ s/<\/RECORDS><\/XML>//;
$lines =~ s/\/RECORD>/\/RECORD>\n/g;

# make an array of records
@linelist = split(/\n/, $lines);
$linecount = @linelist;
print "$linecount\n";

# array of lists
my @group = ();

# open and start reading the list of journal names
open (SED, "<sed_nodots.sed") or die "cannot open sed_dots.sed";
$count = 0;
while (<SED>) {
    $count++;
    print "$count\n";
    $sedstr = $_;
    chomp $sedstr;
    @substr = split(/\|/, $sedstr);
    $sub1 = $substr[1];
    $sub2 = $substr[2];
    $sub2 =~ s/\&/\&amp\;/g;
    $lines =~ s/<SECONDARY_TITLE>$sub1<\/SECONDARY_TITLE>/<SECONDARY_TITLE>$sub2<\/SECONDARY_TITLE>/g;
}
close (SED);

# an array of lines
@linelist = split(/\n/, $lines);

# process....
$outfile = "xml_0.xml";
open (OUT, ">$outfile");
$count = 0;
foreach $line (@linelist) {
    $count++;
    # substitute
    $line =~ s/<\/w+>/<\/foobar1>\n\n/;
    print OUT $line;
    $f = $count/100;
    $mod = $count%10;
    $r = (int($count/10))%10;
    if (($mod == 0) && ($r == 0)) {
       close (OUT);
       $outfile = join("\.", join("_", "xml", $f), "xml");
       open (OUT, ">$outfile");
    }
}
close (OUT);