Input .mol files from a directory

User 97b1ba068a

12-01-2015 15:13:12

Hi, I am trying to calculate protonation of a list of compounds from .mol files. 

I have the following command with works perfectly:

cxcalc -N ih majormicrospecies -H 7.3 compound.mol | cxcalc formalcharge formula

and the output is:

1, -2, compound formula (id, formal charge and formula respectively).

The problem is the input file for multiple .mol file. I have over 100 compounds in a directory. How can i read and calculate each file by providing the directory name as input? so i get a list of output file as follows:


1, -2, compound formula (id, formal charge and formula respectively)

2, 0, compound formula 

3, 1, compound formula



Many thanks in advance.


ChemAxon 5fc3e8d7d0

13-01-2015 14:12:42

Dear Filmon,

You can fuse all files into an sdf with molconvert:

molconvert sdf *.mol -o molecules.sdf
cxcalc -N ih majormicrospecies -H 7.3 molecules.sdf | cxcalc formalcharge formula

Or a one-step solution:

cxcalc -N ih majormicrospecies -H 7.3 *.mol | cxcalc formalcharge formula

Best regards,