Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

The Insider's Guide to Accessing NLM Data

Customizing your output format with EDirect

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