<pre>
# encoding: utf-8 import xlrd # 读取 Excel 文件(表及其字段信息), # 每个表生产一个 txt (特定json格式的表结构信息) def read_excel(file_path): rows_value = read_excel_rows(file_path) # 读取 Excel 内容 table_code = '' # 表编码 table_name = '' # 表名称 table_num = 1 # 标记不同的 table fields = '' # 表输出的格式 table_fm = '{\n\t"tableCode": "%(tableCode)s",\n' \ '\t"tableName": "%(tableName)s",\n' \ '\t"fields":[\n' \ '%(fields)s\n' \ '\t]\n' \ '}' # 表字段输出的格式 field_fm = '\t\t{\n' \ '\t\t\t"fieldCode": "%(fieldCode)s",\n' \ '\t\t\t"fieldName": "%(fieldName)s",\n' \ '\t\t\t"