'''Created on Jan 15, 2013
@author: dongdong.zhang'''
#Install Python for Windows Extension from http://sourceforge.net/projects/pywin32/
importwin32com.client as win32importosimportreimportsysimportgetopt#Load MS Word document and return the document object
defload_word_document(wordFile):
word= win32.Dispatch("Word.Application")
word.Visible=0
word.Documents.Open(wordFile)
doc=word.ActiveDocumentreturndoc#The config file is plain text lines#Each line has two fields separated by white spaces, the first field is index, the second field is the db table name#
#Example:#3 cap_floor#4 coll_grp#5 coll_grp_delinq_hist#6 coll_grp_loan_hist#
#Read each line and store it in a dictionary with the index as key and the table name as value.
defparse_config(configFile):
file_object=open(configFile)
all_lines=file_object.readlines()