If it is for an SD file and if you are on unix, you could do
  fgrep -c "M  END" <sdfile>
or
  fgrep -c '$$$$' <sdfile>


Just check that the last line is also '$$$$', otherwise you
may have to add 1.

If it is for a mol2 file, you could do
  fgrep -c "@<TRIPOS>ATOM" <mol2file>


If you are on Windows, open a DOS prompt and substitute 

"fgrep -c" above with "find /c".

etc. etc.


Ling





>________________________________
> From: Chris Swain <sw...@mac.com>
>To: openbabel-discuss@lists.sourceforge.net 
>Sent: Saturday, August 17, 2013 12:09 PM
>Subject: [Open Babel] Count Molecules
> 
>
>Hi,
>
>Is there a way to simply count the number of molecules in a file?
>
>Cheers
>Chris
>
>------------------------------------------------------------------------------
>Get 100% visibility into Java/.NET code with AppDynamics Lite!
>It's a free troubleshooting tool designed for production.
>Get down to code-level detail for bottlenecks, with <2% overhead. 
>Download for free and get started troubleshooting in minutes. 
>http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
>_______________________________________________
>OpenBabel-discuss mailing list
>OpenBabel-discuss@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to