The problem was with forgetting to add writer.close()
It fixed the problem.

public static void writeSDF() throws IOException, CDKException, Exception
    {
        String filename = "/Users/lochana/Desktop/test.sdf";
        SDFWriter writer = new SDFWriter(new FileWriter(new File(filename)));
        for (IAtomContainer ac : compounds) {
           writer.write(ac);
        }
        writer.close();
        System.out.println("Done!");
    }
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to