import os
from openpyxl import load_workbook
file_path = os.path.join("../log", "test2.xlsx")
# print(file_path)
wb = load_workbook(file_path)
# print(wb.worksheets) # 获取所有的工作表,list
sheet = wb["设备明细"]
# print(sheet) # get the sheet
# 定义创建机构信息的
def information():
start_line_number = int(input("please input the start line:"))
end_line_number = int(input("please input the end line:"))
# 指定行输出特定数据,用于新增机构代码时使用
for row in sheet.iter_rows(min_row=start_line_number, max_row=end_line_number):
# print(row)
SN = row[3].value
Province = row[4].value
Prefecture = row[5].value
Network = row[7].value
Sub_Branch = row[9].value
Address = row[10].value
Institution_code = str(row[29].value)
Replace_S_E = str(Institution_code.replace("S", "E"))
Credit_ins_num = Replace_S_E.replace(Replace_S_E[-4:], "0000")
#
# ####English version
print("SN:{}\n"
"Province:{}{}分行\n"
"Network:{}\n"
"Sub_Branch:{}\n"
"Address:{}\n"
"Institution_code:{}\n"
"Credit_ins_num:{}\n".format(SN, Province, Prefecture, Network, Sub_Branch, Address, Institution_code,
Credit_ins_num))
# ####chinese version
print("设备编号:{}\n"
"机构代码:{}\n"
"分行名称:{}{}分行\n"
"金融网络:{}\n"
"网点名称:{}\n"
"网点地址:{}\n"
"征信编号:{}\n".format(SN, Institution_code, Province, Prefecture, Network, Sub_Branch, Address,
Credit_ins_num))
information()
package_import1
最新推荐文章于 2024-11-13 17:26:18 发布