package_import1

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()


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值