.. _section_example_oechem_gettitles:

Get molecule titles
================================================================================

A program that prints the molecule titles found in an input molecule
database.  The program will output the titles to stdout if no output
file is set. Molecules with no title are shown as "untitled".

Example
--------------------------------------------------------------------------------

.. oe:language:: c++

   .. code-block:: console

      prompt> gettitles input.oeb.gz

.. oe:language:: python

   .. code-block:: console

      prompt> gettitles.py input.oeb.gz

.. oe:language:: java

   .. code-block:: console

      prompt> GetTitles input.oeb.gz

.. oe:language:: csharp

   .. code-block:: console

      prompt> GetTitles input.oeb.gz

Code
--------------------------------------------------------------------------------

.. oe:language:: c++

   .. only:: oehtml

      .. admonition:: Download code

         :download:`gettitles.cpp <../../../../../sublibs/tklibs/oechem/examples/gettitles.cpp>`

   .. only:: oepdf

      .. oe:source:: gettitles.cpp
         :language: c++

.. oe:language:: python

   .. only:: oehtml

      .. admonition:: Download code

         :download:`gettitles.py <../../../../../wrappers/python/examples/oechem/gettitles.py>`

      .. literalinclude:: ../../../../../wrappers/python/examples/oechem/gettitles.py


   .. only:: oepdf

      .. oe:source:: gettitles.py
         :language: python


.. oe:language:: java

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GetTitles.java <../../../../../wrappers/java/examples/openeye/examples/oechem/GetTitles.java>`

   .. only:: oepdf

      .. oe:source:: GetTitles.java
         :language: java

.. oe:language:: csharp

   .. only:: oehtml

      .. admonition:: Download code

         :download:`GetTitles.cs <../../../../../wrappers/csharp/Csharp-Examples/OEChem/GetTitles.cs>`

   .. only:: oepdf

      .. oe:source:: GetTitles.cs
         :language: csharp

.. seealso::

   * :oe:meth:`OEChem::OEMolBase::GetTitle` method

