Ready to be published? LXer is read by around 350,000 individuals each month, and is an excellent place for you to publish your ideas, thoughts, reviews, complaints, etc. Do you have something to say to the Linux community?
There are parsers available in various programming languages for breaking chemical formulas into elements and their proportions. Here I do the job with AWK and calculate the formula's mass per mole.