#654 A CDK MDL file contains mixture of line-endings

cdk-1.0.x
closed
5
2012-11-03
2008-05-18
No

On Windows, MDLWriter creates an output file with Unix line-endings for the header, and Windows line-endings for everything else, instead of using Windows line-endings throughout.

On Windows, with Jython (the input and output files are attached):

from org.openscience.cdk import
from org.openscience.cdk.io import

from org.openscience.cdk.io.iterator import *
from java.io import InputStreamReader

molinput = open("diMePh.sd","r")
mol = MDLReader(molinput).read(Molecule())
molinput.close()

moloutput = open("diMePh_CDK.sd","w")
writer = MDLWriter(moloutput)
writer.write(mol)
moloutput.close()

Discussion

  • Noel O'Boyle

    Noel O'Boyle - 2008-05-18

    input

     
  • Noel O'Boyle

    Noel O'Boyle - 2008-05-18

    Logged In: YES
    user_id=850620
    Originator: YES

    File Added: diMePh_CDK.sd

     
  • Noel O'Boyle

    Noel O'Boyle - 2008-05-18

    output

     
  • Egon Willighagen

    Logged In: YES
    user_id=25678
    Originator: NO

    OK, seems to be writer.newLine() versus write("\n")...

    Please verify the jar from Nightly... (the CDK 1.0.x version of it...)

    I'll release it in 1.0.3 today... at least, it is consistent now. Please reopen of it does not fix things properly.

     
  • Nobody/Anonymous

    Logged In: NO

    Verified as fixed in CDK 1.0.3. Thanks.
    - Noel

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks