Ingesting PubMed Citations into EndNote with Citation URL

28 Oct 2012

I've recently picked up some research I'd let sit idle. While gathering data to analyze, I realized there's no link to the PubMed citation page when I pull PubMed citations into EndNote. Why would this URL be useful? Having this link in EndNote makes it easy to toggle between articles and EndNote (where my research data lives). Plus, with a LibX toolbar installed in Firefox, the PMID (PubMed ID) number on the PubMed citation page magically (i.e. via link resolver) turns into a link to the article. This is a HUGE timesaver.

There are a variety of ways to get data from PubMed into EndNote, and the instructions on EndNote's support page are as good as any, so I began with those and added a few extra steps to grab the URL. What follows would occur after you download the data from PubMed and before you open EndNote. To do this, you'll need a text editor that can perform regular expressions - I used BBEdit although most editors will work (MS Word, Notepad++, and so forth).

  1. Once you have your citations selected in PubMed, download them. Click Send to, Chose Destination: File. Format: Medline. Create File.
  2. Open the file in your text editor.
  3. As you can see, there's no URL, so we have to create one. Thankfully, there's a simple formula for this: '' + 'PMID' = URL. For example, is the link for the article with PMID of 15063148.

    So, all we need to do is copy the PMID and paste it into a new line with the '' prefix. This can be accomplished using some regex and the find and replace feature. First, make sure your find and replace function is ready to parse regex - in BBEdit this means check the 'Grep' box. (quick BBEdit grep primer)

  4. Find: (PMID- (.*))
  5. Here's a quick breakdown of what's going on: this is searching for the string 'PMID- ' and anything that comes after that string. The '.*' matches any character for zero or more occurences - this is what finds the PMID number.

    In regex, you can create a pattern using parenthesis. Since we've used two sets of parenthesis, we have two patterns that we can call in the replace string.

  6. Replace: \1 \rURL -\2
  7. '\1' is calling the first pattern from the Find command - we're putting back the entire line because we still want the PMID. '\r' is a line break. 'URL -' is the text we want the new line to begin with. '\2' is the second pattern, the PMID.

  8. Test first! Do 'Find all' to make sure the number of occurrences it finds equals the number of citations in the file, no more and no less.
  9. Replace all. That's it!

Epilogue: Why does the new line have to begin with 'URL -'? This is how it's pulled into EndNote's PubMed filter. You can see this by going in EndNote to Edit > Import Filters > Open Filter Manager, go to PubMed (NLM) and click edit, then choose Templates. You'll notice these fields are very similar to the ones in the text file we were just editing.

blog comments powered by Disqus
  • Email:
    Twitter: @coblezc
  • CC-BY