TCL scripts for TMW database building