Customizing your output format with EDirect

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.