openbabel oneliners

openBabel File Conversion

What do you do if you have multiple files in a folder, and you want to convert them all to a different filetype and retain the filenames? Use openBabel, of course!

Here is a very simple one-liner to convert multiple files from one format to another while retaining the original filename.

 babel -ig09 *.log -omol -m 

In this example, a Gaussian output file is converted into a molfile.  For XYZ to pdb the change would be:

 babel -ixyz *.xyz -opdb -m 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s