This is really easy to do with a scripting language like Perl. Attached is
a tar with two files:

   - SDF.pm, a general-purpose SDF parser (it can read files, standard
   input, or from an array)
   - sdf_filter.pl, which does exactly what you're looking for.

Extract the two files to a directory ("tar xvf sdf-filter.tar"). See the
documentation in SDF.pm for how to refer to the molecule's title.

In this case, you'd do:

cd sdf_filter

./sdf_filter.pl _TITLE_ 9782


Craig

On Sun, Nov 5, 2017 at 4:49 PM, Sundar <jubilantsun...@gmail.com> wrote:

> Hi,
>
> I was trying to extract a single molecule from a multimolecular sdf.
> I used the following but it didn't work.
>
> obabel ../input/in-3D.sdf -O 9782.sdf --filter "title='9782'"
>
> Let me how can I do this.
>
> Thanks,
> Jubilant
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>


-- 
---------------------------------
Craig A. James
Chief Technology Officer
eMolecules, Inc.
---------------------------------

Attachment: sdf-filter.tar
Description: Unix tar archive

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to