I usually use grep too, but I understand what you're saying - it's a common task we should automate (e.g. "-ocount"). In the meanwhile, you could speed it up quite a bit by turning off some of the perception, i.e. -aT (read title only).
- Noel On 18 August 2013 07:35, Chris Swain <sw...@mac.com> wrote: > Hi, > > Thanks for the suggestions > > At the moment I use > > /usr/local/bin/obabel '/Users/swain/Desktop/acetophenones.sdf' -onul -v > 'FFFFF' 2>&1 |cut -d " " -f1 > > Which does work but I was wondering if there was a command I was missing > > Cheers > > Chris > > > On 18 Aug 2013, at 03:13, "S.L. Chan" <slch...@yahoo.com> wrote: > > 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 > ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss