Skip Navigation Bar
NLM logo

Customizing your output format with EDirect


Please note: following the release of the new version of PubMed, the results returned by E-utilities queries of PubMed may differ slightly from those returned in the web version of PubMed. A new PubMed API is currently under development: more information will be announced when available.

As new Insider's Guide classes are no longer being offered, this site is not currently being updated. Please refer to NCBI's E-utilities documentation for more up-to-date information.


As mentioned in previous sections, many EDirect commands (like esearch, efetch, and einfo) are designed to create E-utilities queries quickly and easily. However, EDirect also includes a few commands that do not use E-utilities at all. These commands do not create E-utilities URLs, and do not query NCBI databases. Instead, these commands help you process the output of other EDirect commands.

The most powerful of these commands is xtract. The xtract command can extract specific data elements from an XML document and output them in a tabular format that can be analyzed or visualized in data analysis software (like Microsoft Excel). The xtract command has a range of arguments that let you control exactly which data you would like included in your table, and how it should be arranged. Other EDirect commands assist in quantifying your data, parsing text passages for text-mining, and more.

Additionally, one of the great advantages of EDirect is that it works in a Unix environment, so in addition to all of the EDirect commands, you have a wide array of Unix tools at your disposal. There are Unix utilities to sort, trim, compare, edit, and translate text, along with hundreds of other functions. Incorporating some of these Unix commands, or a little programming knowledge (especially if you are familiar with the Perl or Python programming languages) can make your EDirect solution even more powerful.

Last Reviewed: August 6, 2021