Hello,

I would like to convert a file File.xyz into a SMILES string in a C++
program. I have done the following (I am simplifying):

ifstream input("File.xyz");
ostringstream streamOBabel;
OpenBabel::OBConversion conv(&input, &streamOBabel);
conv.SetInAndOutFormats("XYZ","SMI");
conv.Convert();
string smilesString = streamOBabel.str();
cout << smilesString << endl;

I don't know if it is the best way, but it works. However,
smilesString contains the SMILES string and then the title of File.xyz
(I call title what is written in the second line of File.xyz, after
the number of atoms in the molecule and before the cartesion
coordinates). I would like to keep only the SMILES string. Is there a
way to do it, with some options?

Thank you for your help.

Nicolas

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to