Chemeq : a chemical equation parserchemeq V1.10-2, ©2000-2002 G. Khaznadar <georgesk @boltz.univ-littoral.fr>Chemeq is hosted as a project at Savannah-GNU |
2H2 + O2 ---> 2 H2Oand can outputs LaTeX code, many useful messages and much more.
example:~$ echo "2H2 + O2 ---> 2 H2O" | chemeq -lc 2\,H_{2}\,+\,O_{2}\,\rightarrow\,2\,H_{2}O OK |
When the input is not successfully parsed, the filter fails with the exit code 1.
example:~$ echo "2H^2 + O2 ---> 2 H2O" | chemeq -lc ERROR parse error at 4 |
example:~$ input="1/2 H2 + 1/2 O2 -> 1/2 H2O" example:~$ template="H2 +O2 ->H2O" example:~$ if [ "$(echo $input|chemeq -n)" = "$(echo $template|chemeq -n)" ]; then > echo match; > else echo no match; > fi match |
Examples : H3O^+, Fe(CN)6^4-, OH^- |
This software snippet is GPL, see the file COPYING.
Feedback is welcome.