PubMed2XL 2.01

Table of Contents



Using PubMed2XL

Changing Settings

Advanced Capabilities for Developers



PubMed2XL is a Microsoft Windows and Linux application that can convert citations to Microsoft Excel 2007 (.xls) or OpenDocument (.ods) spreadsheets.

PubMed2XL is licensed under the MIT software license.

PubMed2XL includes software developed by Roman V. Kiseliov.


You can download PubMed2XL by clicking on one of the links below.

Click here to download the Windows self-installer (Windows).

Click here to download the ZIP file (Windows/Linux).

The Windows installer will create a shortcut to the main application in the same directory in which you install the software as well as in the Start Menu.

Both download files contain Windows executables and the Python source code. Linux users can run the Python files after installing the dependencies noted in the "/docs/DEPENDENCIES.TXT" file.

PubMed2XL 2.0 has been tested on 32-bit versions of Windows 7 and Linux Mint Xfce Edition.

I would like to provide a self-installing Mac OS version one day. If someone can help compile one, please leave me a note. Thanks!

Older versions can be accessed here.

Using PubMed2XL

To learn how to install (Windows) and use PubMed2XL, please see the video tutorial below.

PubMed2XL: Basic Installation and Use from nitin arora on Vimeo.

Changing Settings

The "Options" tab (image below) gives users options for:

  1. selecting the output between Excel 2007 format and OpenDocument spreadsheet format using the "Toggle Output Format" option,

  2. selecting whether or not to process citations from books using the "Toggle Book Citations" format,

  3. and altering the spreadsheet column output (see "Stylesheets" below).

The "Preferences>Save Preferences" command allows users to save any changes to the options.

PubMed2XL Options tab


Pubmed2XL uses "stylesheets" to determine the output format of the spreadsheet that it creates. In other words, things like column order, column title, and the PubMed data placed in a given column's cell is controlled by a PubMed2XL stylesheet.

Users can specify a different stylesheet by clicking on "Options>Change Stylesheet" prior to using the "Tools>PubMed XML to spreadsheet" command.

Creating Stylesheets

Users familiar with XML and the specific XML outputted by PubMed can change the format of the outputted Excel file that PubMed2XL creates by creating their own stylesheet. Using an external stylesheet in a well-known markup language allows researchers and librarians, etc. to customize PubMed2XL's output and to easily share stylesheets with each other and their friends and patrons.

More information and instructions for making new stylesheets can be seen in the Pubmed2XL stylesheet XSD located at "./styles/schema/". By studying the schema document and the default stylesheet, advanced users can better customize PubMed2XL to their needs.

Starting with version 1.0, PubMed2XL uses XSLT 1.0 as the only method of parsing data from PubMed XML files. This is in contrast to 9.x versions that used a home-grown XML processing language. As such, PubMed2XL 1.0+ is not backwards compatible with version 9.x stylesheets. The move to XSLT was to accommodate requests from users for more capabilities.

If you need assistance customizing a stylesheet, please leave a comment below so that we can all work together. Thanks!

Here is an example stylesheet that will make a spreadsheet with on column called "PMID" in which the PubMed article ID value will be placed. The data in the cell is hyperlinked to the article's page on using the optional <hyperlink> element.

<?xml version="1.0" encoding="UTF-8" ?>
<spreadsheet xmlns:xsi="" xsi:noNamespaceSchemaLocation="schema/PubMed2XL-2.0.xsd">
            <xsl:stylesheet version="1.0" encoding="UTF-8" xmlns:xsl="">
            <xsl:output method = "text" />
            <xsl:template match="/">
                <xsl:value-of select="//PMID" />
            <xsl:stylesheet version="1.0" encoding="UTF-8" xmlns:xsl="">
            <xsl:output method = "text" />
            <xsl:template match="/">
                <xsl:value-of select="//PMID" />

Advanced Capabilities for Developers

The PubMed2XL GUI application is, as of version 2, built atop a Python library, "".

The goal of the library is to provide developers a way to automate tasks from searching PubMed programmatically, to creating PubMed XML files from a list of PMIDs (PubMed IDs), and to – of course – making a spreadsheet from a PubMed XML file. If you are a programmer and use the library, I'd really appreciate feedback as to how you use the library as well as any constructive criticism.

Advanced users with Python programming skills can use the library in other scripts and for task automation. Any of the "" functions can also be called via the command line, allowing it to be used by programmers who prefer other scripting languages.

For example, consider the "makeSheet()" function which converts a PubMed XML file into a spreadsheet.

To call the function from the command line one can do the following:

$ python ./ makeSheet('myPubMedXML.xml', outputFile='myPubMedSpreadsheet.xls')

Note, that only single quotation marks can be used when enclosing strings from the command line. Also note that, on error, the script will return a "1" unless the string "DEBUG" is passed as the last argument as in the example below – which also demonstrates using the Windows ".exe" version of the library instead of the Python version.

$ pm2xl.exe makeSheet('myPubMedXML.xml') DEBUG

For more information on the library functions, please see the PyDoc documentation located at "./docs/pm2xl.html".


  1. How many citations can PubMed2XL process?

    • PubMed2XL is not recommended for processing an XML file of PubMed citations for more than a few thousand citations (less than 5k).

      • I've tested PubMed2XL for ~5,000 records. The XML file downloaded from was roughly 50 megabytes. It took PubMed2XL less than 1 minute to create an 8 megabyte Excel (.xls) file.

      • I also tested nearly 25k records using a development version of PubMed2XL from the command line. That took approximately 1.5 hours to process and it took OpenOffice almost 10 minutes just to open the spreadsheet.

      • Both tests were on my Lenovo T510 (431328U) and used the default Pubmed2XL stylesheet which is verbose as it retrieves a lot of data from the PubMed citations including abstracts.

  2. I don't have Excel. Can I still use PubMed2XL?

    • PubMed2XL creates an Excel (.xls) file that can also be opened in OpenOffice and other applications, including Google Docs

  3. Why do I see the message "File Error: data may have been lost." in Excel when I open a file created by PubMed2XL?

    • PubMed2XL uses the Excel 2007 format (.xls) instead of the newer format (.xlsx); this seems to be the sole culprit in generating the error message. If you are using Excel 2010+ and are seeing this error, try clicking through the error and use the "Save As" command to save the PubMed2XL file in the newer Excel format (.xlsx) and delete the ".xls" file created by PubMed2XL. I've never seen that any data was actually lost despite the error message.

  4. I don't want to create an Excel (.xls) file and/or I prefer to use OpenOffice or LibreOffice, etc. Can PubMed2XL create Open Document (.ods) spreadsheets?

    • Yes. Just use the "Options>Toggle Output Format" command. Programmers can use set the extension to ".ods" using the "outputFile" argument in "makeSheet()".

  5. Does the software process book-based citations if found within the XML?

    • By default, no. But you can, as of version 2.0, use the "Options>Toggle Book Citations" command.

    • Note that the default stylesheet included with the software is tailored to journal citations. As such, many of the columns for book citations will likely be left blank.


Related Content:

56 Responses

  1. Nice work – this is a very handy tool!

    by clsnyder on Dec 6, 2010 at 8:21 pm

  2. Thanks for leaving a comment! – and for checking out the software.

    by nitin on Jan 16, 2011 at 4:30 pm

  3. Hi Nitin,
    I tried to download and install your software in VMware Fusion, which is a Mac Virtual MS OS.  The program appears to install ok but will not read the PubMED txt (XML) file.  Do you need Excel installed for your program to work?

    by Jim on Feb 16, 2011 at 8:34 pm

  4. Hey Jim,
    Excel isn’t required – I have OpenOffice. Can you send me a copy of the XML file you are trying to use?
    You can email it to:
    nitaro74 AT gmail DOT com

    Thanks and sorry for the trouble.

    by nitin on Feb 16, 2011 at 10:21 pm

  5. Dear Nitin,
    This is AWESOME!!!

    by Cardiovascular researchers on May 15, 2011 at 2:47 pm

  6. This is awesome and so much faster than the workarounds I was thinking of to extract out the abstracts. I got my CSV file…which is great and then was trying to think of a way to get the abstracts in there for reference. This saved me a lot of time and was very easy to use. The default output is great and it is pretty easy to customize if you would like an alternative output.  Thanks.

    by Alison on Jul 28, 2011 at 3:39 pm

  7. Thanks Alison. I’m glad it’s useful.

    by nitin on Jul 28, 2011 at 5:32 pm

  8. Nitin,
    This was just what I needed to round out a set of Excel macros. I could not work out how extract XML info in VBA, so this does the trick wonderfully.
    2Qs though
    1)I have Excel 2010 in WIn7 x64. When I open your Excel output it says “File error: data may have been lost”. Everything seems OK but I don’t know what is happening. Any ideas?
    2) Is there a way to alter the file output name to a generic like “pubmed result”? I would like my macro to identify and open the data directly, but with the variable file name it makes life tricky.

    Thanks again,

    by Aidan on Aug 3, 2011 at 11:52 am

  9. Hey Aidan,

    I’ve seen that same error on Office 2010, but I can’t see any evidence of a real problem. I don’t know much about the library I’m using to make an Excel 2007 file, but that might have something to do with it.

    As far as the outputted filename, the only way (other than to rename the file after the fact) is to use the command line version:

    $ PubMed2XL-1.0-CL --in="pubmed_result.xml" --out="pubmed_result.xls"

    The example above assumes you downloaded the PubMed XML file to the same folder as the PubMed2XL application and that you want to save the spreadsheet to the same directory.

    by nitin on Aug 3, 2011 at 4:28 pm

  10. Thanks Nitin.

    by Aidan on Aug 3, 2011 at 4:42 pm

  11. Hi Nitin,

    I know nothing about XML coding, but have spent several hours trying to figure out how to add to your default stylesheet the additional information for "Affiliation".  Help please!


    by Robert on Sep 11, 2011 at 8:30 pm

  12. Hey Robert,

    There appears to only be one Affiliation listing per article.

    You can try saving this file: and placing it inside PubMed2XL’s “styles” folder.

    Make sure it’s saved as an XML file such as “robert_091111.xml”.


    - launch PubMed2XL
    - select the XML file you just downloaded
    - then choose FILE>CONVERT PUBMED FILE and process the PubMed XML file from

    This is for PubMed2XL version 1.0 or higher only. Let me know if this helps.


    by nitin on Sep 11, 2011 at 9:37 pm

  13. Thank you for your work on this program, it is perfect for what I need to do.

    by Dave on Sep 19, 2011 at 1:29 pm

  14. great tool!….. makes my work much easier :)

    by Prachi on Oct 12, 2011 at 4:57 am

  15. Thnx, so much for this great application.
    Been using an old script from your blog for my last project – this solution is perfect! Prehaps a GUI for selecting what columns to put in the output file is in v2.0?
    In the most pubmed listings a "publication type" tag has been added but it often contains several lines – any ideas how to handle this so you can sort in "reviews" "case reports" "RCT's" etc.
    A danish user

    by Theis Itenov on Oct 14, 2011 at 5:00 pm

  16. Hey Theis,

    Thanks for the feedback.
    I like the GUI builder idea! I’ve added it to my to-do list.

    As far as Publication Type, I *think* I know what you mean.
    You can try saving this file: and placing it inside PubMed2XL’s “styles” folder.

    Make sure it’s saved as an XML file such as “theis_101411.xml”.

    - launch PubMed2XL
    - select the XML file you just downloaded
    - then choose FILE>CONVERT PUBMED FILE and process the PubMed XML file from

    There should now be in Column O a “Publication Type(s)” field containing semicolon separate values for each publication type a la:
    “Journal Article; Research Support, Non-U.S. Gov’t”.

    Then you can filter the data with the spreadsheet software’s “Filter” feature by things such as:
    Contains “Journal Article”
    AND Does not Contain “Research Support”, etc.

    I don’t know if that helps. If not, let me know and maybe we can figure something out.

    by nitin on Oct 14, 2011 at 9:56 pm

  17. GOD BLESS YOU, sir! This saved me bazillions of hours!!

    by Aaron on Oct 17, 2011 at 1:56 pm

  18. May you help me create a stylesheet that exports only the PMID, Title, First Author's Name, Pub Date, State/Country of 1st author, Journal Name, Abstract? Until then, I will just download the default and delete unneeded columns. MUCH THANKS!

    by Aaron on Oct 17, 2011 at 2:04 pm

  19. Hey Aaron,

    Thanks for the feedback.

    You’re lucky I’m home sick today, so I took a stab at the stylesheet.
    If it isn’t what you want, I would need more detail from you so you’d need to email me off-list.

    Re: first author’s location, I used the Affiliation field which may or may not have the information.

    You can go here:
    And download the file with your name on it. Make sure to save it with an XML extension (“yourFilename.xml”) inside PubMed2XL’s “styles” folder.

    - launch PubMed2XL
    - select the XML file you just downloaded
    - then choose FILE>CONVERT PUBMED FILE and process the PubMed XML file from


    by nitin on Oct 17, 2011 at 4:14 pm

  20. Would you be able to put together style sheet that included all the basics but with PUBLICATION TYPE and AUTHOR Location.  That would be fabulous.
    Many thanks

    by Steve on Oct 24, 2011 at 1:28 pm

  21. Hey Steve,
    If you just need to remove Publication Type and Author from the default output, it’s pretty easy to delete these in Excel, etc. You could even record a macro in your spreadsheet program to do that with one click.

    by nitin on Oct 24, 2011 at 2:05 pm

  22. Nitin, 
    Sorry if I was not clear.   I was after an output style that included BOTH, PUBLICATION TYPE and AUTHOR LOCATION.
    so a combination of the two styles you have added above.
    Many thanks
    p.s. excellent piece of work by the way

    by Steve on Oct 26, 2011 at 1:14 pm

  23. Thanks, the other program worked great! Sorry for delayed response.
    I was hoping that there would be a way to pull out the country of the first author's affiliation, rather than the name of institution, etc. But that may be more difficult since the country appears in different places in that string of text.
    Much thanks!

    by Aaron on Oct 27, 2011 at 4:22 pm

  24. Hey Steve,

    My bad.
    Here’s the style sheet (check columns “O” and “S”):

    Let me know if it works.

    by nitin on Oct 27, 2011 at 8:37 pm

  25. Nitin
    Thanks, you have solved a problem I have been strugling with for some time, i have used work arounds through web of sceince which can export to excel however i do prefer Pubmed.
    Is there a style which could let me export all the fields to excel? I can later decide if i use them in my database.

    by Oren on Dec 29, 2011 at 9:34 am

  26. Hi Oren,

    I don’t have a style which would export everything. One of the problems is that I don’t know all the elements, though one could perhaps generated a generic “catch-all” style by parsing the document type definition for PubMed – something like this: But this would still be sub-optimal given that there are still questions related to how to display multi-valued fields like all the authors, MESH terms, etc. within one cell.

    If you are putting it into a database, you might be able to directly import the XML file into Excel (if you have Excel). I think one could use the import “as a read-only workbook option” – or something. I think you’ll have duplicates that way (i.e. row per author per PMID), but maybe that could be cleaned up with a pivot table or database query. Actually, that might be more desirable than only having one row per article since the latter is less granular.

    by nitin on Jan 1, 2012 at 8:43 am

  27. Hi Nitin,
    You helped me with a new stylesheet that pulls the first author's affiliation. I used this a few months ago successfully, but now it doesn't seem to be working. I have selected to use that custom style sheet, and restarted the program and my computer, but there is still no affiliation column. Any thoughts? Much thanks!

    by Aaron on Feb 26, 2012 at 5:50 pm

  28. Hey Aaron,

    I can check it out. I’ll need you to send me the following at my email (nitaro74 AT gmail DOT com):
    - version of PubMed2XL you are using
    - a copy of the XML file you got from PubMed (i.e. email as attachment)
    - a copy of the stylesheet (as email attachement)
    - a copy, if you have it, of the outputted Excel file (as attachment).


    by nitin on Feb 26, 2012 at 5:53 pm

  29. Ok, I sent you an email. Thanks!

    by Aaron on Mar 3, 2012 at 7:47 pm

  30. A stylesheet that outputs everything would be ideal. For my situation, and I am guessing many others, the best way to handle multi-value fields (like authors, MeSH, etc) would be to put all the values in one cell with a delimiter like a double verticle pipe (||).

    by David on Aug 8, 2012 at 1:39 pm

  31. Hey David,

    Thanks for writing. This really isn’t possible with the software as it wasn’t designed to that. Getting everything really would be a job for a totally new script. But there would be semantic issues in regard to naming the column fields per the data that got extracted – which is likely to vary from article to article within the XML. At some point this kind of thing also raises questions about trying to totally flatten out nested data in the first place and would likely point to the need to ingest the XML in a native XML database.

    If you have Excel you could try importing the XML directly though I imagine that would require a lot of cleanup.

    by nitin on Aug 8, 2012 at 10:34 pm

  32. Thank you very much for this software.
    This will save me many hours of work !!!
    It is perfect for what I need to do (bibliometric analysis) using pubmed data

    by boudry on Feb 1, 2013 at 9:55 am

  33. Thanks Christophe.

    Keep an eye out for a new version (I’m aiming for early March).

    The new version will still have a GUI interface, but will also be a Python module and a command line tool – the latter two being helpful if you really want to do some serious automation and integrate PubMed2XL into other scripts.


    by nitin on Feb 1, 2013 at 2:58 pm

  34. Many thanks for your tool, it look very useful. However, even though  I have followed step by step the instructions, I cannot generate the Excel file. To be honest, I don't know what is going on. I have Excel 2010 and Windows 7.

    I'll really appreciate your kind help.

    by Oscar on Feb 12, 2013 at 4:07 pm

  35. Oscar and I figured out that the most likely reason this wasn’t working was an accent mark and/or whitespace in his Windows user name. When he moved PubMed2XL to C:\PubMed2XL it worked (i.e. bypassing the path with his user name).

    Something for me to keep in mind for version 2.

    by nitin on Feb 18, 2013 at 10:50 am

  36. What a fabulous tool, thank you so much! I can't believe I have been doing so many lengthy procedures for so long. 
    I have a question if you are able to help please. I would like to have a column in which the URL for the PMID is displayed as a hyperlink that actually shows the text instead of just the PMID number (if that makes sense). I know  I could do this manually in Excel, I am just unsure of how to modify the xml style to do this automatically. 
    Any help would be greatly appreciated.
    Thank you

    by Andy on Mar 6, 2013 at 12:26 pm

  37. Hey Andy,

    If I understand correctly, you want a column with a link to the article that shows the actual full link in the column?

    If so, try downloading this style:
    and storing it in the “/styles” folder.

    When you run PubMed2XL, go to “Tools>Select Stylesheet” and select “andy_030613.xml” before selecting “File>Convert PubMed File”.

    by nitin on Mar 6, 2013 at 2:03 pm

  38. Hi Nitin,
    That is perfect. Thank you so much :-) I am so impressed with this tool and it saves so much time. What a great job!

    by Andy on Mar 7, 2013 at 4:00 am

  39. Hi, Nitin, it seems fantastic program i've ever seen !  however it doen's work for me T.T
    i am using excel 2007, it doesn't work ..
    if I click "convert pubmed file" and select "PubMedResults.xml", PubMed2XL stops.
    it does not show me any pop-up, and not create any xls files.
    what should i do ?

    by Doreen on Apr 28, 2013 at 4:07 am

  40. Hi Doreen,

    I’ll need you to send me the following at my email (nitaro74 AT gmail DOT com):
    - version of PubMed2XL you are using,
    - a copy of the XML file you got from PubMed (i.e. email as attachment).

    You can get the version number by using the Help>About menu option.


    by nitin on Apr 28, 2013 at 11:01 am

  41. Thank you!! Thank you!! This was exactly what I needed, I was trying all day with the .XML file in EXCEL and ACCESS and couldn't find the way to organize the data in a logical way, and then with like 5 clicks my work was done!!!  God bless you, Melissa

    by Melissa on Aug 27, 2013 at 4:00 pm

  42. Thanks for leaving a comment.

    I’m glad it’s helping.

    - Nitin

    by nitin on Aug 27, 2013 at 4:15 pm

  43. I'm excited to try this thing. I'm wondering, though, if I start a new search session, can I append to the same spreadsheet of a previous session? 

    by Oliver on Oct 31, 2013 at 5:02 pm

  44. Hey Oliver,

    Thanks for the question.

    PubMed2XL can’t achieve this, but you should be able to use your spreadsheet application (Excel, etc.) to copy/paste and combine two different spreadsheets.

    If you have Excel you might want to take a look at this add-in called RDBMerge ( to combine multiple spreadsheet files.

    Hope this helps,


    by nitin on Oct 31, 2013 at 11:31 pm

  45. Thanks very much, Nitin. That looks like a very good solution. BTW, so far, despite having to cut-and-paste new records to my existing spreadsheet, I'm finding PubMed2XL very handy! 

    by Oliver on Nov 5, 2013 at 5:04 pm

  46. Glad to hear it’s handy.


    by nitin on Nov 5, 2013 at 10:52 pm

  47. hello, does one of you has came up with a stylesheet to extract every meshterms in one cell but separated by commas or | ?

    I am very interested in this but not familiar enough with XML to do it…

    Thanks a lot,


    by jrrok on Dec 3, 2013 at 11:04 am

  48. Just FYI to any other readers,

    jjrok now has a stylesheet that supports getting the MESH descriptors in one column, they are SEMICOLON delimited. Note: there’s also a new field for ISSN which got in there and jjrok also added a column for “Chemical Substances”.

    Here’s the link to the stylesheet:

    Note this is compatible with Pubmed2XL versions 1.x and 2.x. I recommend using version 2 of the software.

    by nitin on Dec 8, 2013 at 10:19 am

  49. hi, love your tool! do you have a script to have the last author listed? Thanks a lot, Claudia

    by claudia on Dec 10, 2013 at 4:49 am

  50. Just FYI to any other readers,

    claudia now has a stylesheet that also outputs the Last Author to the default output.

    Here’s the link to the stylesheet:

    Note this is designed for Pubmed2XL versions 2.x.

    by nitin on Dec 16, 2013 at 8:04 am

  51. Hello,

    I am trying to modify the code provided by jkorkou (jkorkou_120813.xml) to get MeSH descriptors AND qualifiers into Excel. Each MeSH descriptor may have zero, one, or more qualifiers. What I would like in Excel is for all the data to go into one cell in the form descriptor/qualifer1/ qualifier2.

    Below is what the XML looks like from PubMed and what I have come up with so far. The problem is that only the first qualifier is coming into Excel. If there is more than one qualifier, it is ignored. Do you have any suggestions? Thank you.

        <DescriptorName MajorTopicYN="N">HIV Infections</DescriptorName>
        <QualifierName MajorTopicYN="N">epidemiology</QualifierName>
        <QualifierName MajorTopicYN="Y">prevention &amp; control</QualifierName>
        <DescriptorName MajorTopicYN="N">Humans</DescriptorName>
        <DescriptorName MajorTopicYN="N">Urinary Tract Infections</DescriptorName>
        <QualifierName MajorTopicYN="N">epidemiology</QualifierName>
        <QualifierName MajorTopicYN="Y">prevention &amp; control</QualifierName>
      <xsl:stylesheet version="1.0" encoding="UTF-8" xmlns:xsl="">
        <xsl:output method = "text" />
        <xsl:template match="/">
          <xsl:for-each select="//MeshHeading">
              <xsl:when test="position()=last()">
                <xsl:value-of select="DescriptorName" />
                <xsl:value-of select="QualifierName" />
                <xsl:value-of select="DescriptorName" />
                <xsl:value-of select="QualifierName" />
      <hyperlink />

    by David on Dec 30, 2013 at 6:57 pm

  52. Since this was a pretty specific/custom request for David’s work, I’m not going to upload a new stylesheet but just going to paste the code below so I don’t lose it.

    <xsl:stylesheet version="1.0" encoding="UTF-8" xmlns:xsl="">
    <xsl:output method = "text" />
    <xsl:template match="/">
      <xsl:for-each select="//MeshHeading">
        <xsl:value-of select="DescriptorName" />
        <xsl:for-each select="QualifierName">
          <xsl:value-of select="." />
        <xsl:if test="position()!=last()">
      <hyperlink />

    by nitin on Jan 11, 2014 at 10:50 am

  53. How is this app supposed to be linux-compliant? Binaries are clearly for Windows, or does the author assume integration of WINE??

    by Thomas on Jan 14, 2014 at 7:38 am

  54. Sorry for the confusion Thomas. To run it on Linux, you’ll have to run the Python files. The dependencies are listed in the “/docs/DEPENDENCIES.TXT” file. What distro/version are you using?

    by nitin on Jan 14, 2014 at 8:16 am

  55. Thanks a lot. I appreciate your effort so much.

    by Arash on Feb 25, 2014 at 1:19 pm

  56. Thanks for the feedback.

    by nitin on Feb 25, 2014 at 1:48 pm

Leave a Reply


Recent Posts


Switch to our desktop site