def merge_xlsx_first_sheet_to_diff_sheets_with_bookname(): """merge the first sheet in files with xlsx suffix to target sheets named their workbook name in current workbook""" sum_sheets(0, suffix=".xlsx", only_copy_first_sheet=True, target_cur_sht=False, target_same_sheetname=False)
def merge_xlsx_first_sheet_to_cur_sheet_NoRow1(): """merge the first sheet in files with xlsx suffix to current sheet in current workbook without first row""" sum_sheets(1, suffix=".xlsx", only_copy_first_sheet=True, target_cur_sht=True)
def merge_csv_to_diff_sheets(): """merge files with csv suffix to diff target sheets named their sheetname in current workbook""" sum_sheets(0, suffix=".csv", target_cur_sht=False, target_same_sheetname=True)
def merge_csv_to_cur_sheet(): """merge files with csv suffix to current sheet in current workbook""" sum_sheets(0, suffix=".csv", target_cur_sht=True)
def merge_cur_wb_to_first_sheet_NoRow1(): """merge sheets to Sheet1 or first sheet in current workbook without first row""" sum_sheets(1, sum_current=True, target_cur_sht=False)
# delete the test data beforeclear() csv_sht_list = sheet_seacrh(wb_sum, [ 'test.csv', 'test', 'test_100.csv', 'test_100', 'test_1000.csv', 'test_1000' ]) for sht in csv_sht_list: if sht.name in ('test.csv', 'test', 'test_100.csv', 'test_100', 'test_1000.csv', 'test_1000'): sht.delete() sheet_seacrh(wb_sum, ['Sheet1'])[0].clear() sheet_seacrh(wb_sum, ['Sheet2'])[0].clear() # test sum all .csv files to diff sheets with filename sum_sheets(ignore_row_num=0, sum_current=False, suffix=".csv", only_copy_first_sheet=True, target_cur_sht=False, target_same_sheetname=False) # test sum all .csv files to diff sheets with sheet name # sum_sheets( # ignore_row_num=0, sum_current=False, suffix=".csv", # only_copy_first_sheet=True, # target_cur_sht=False, target_same_sheetname=True # ) # test sum all .csv files to current sheet # sum_sheets( # ignore_row_num=0, sum_current=False, suffix=".csv", # only_copy_first_sheet=True, # target_cur_sht=True, target_same_sheetname=False