-
Notifications
You must be signed in to change notification settings - Fork 0
/
merger.py
38 lines (29 loc) · 911 Bytes
/
merger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! python3
# coding: utf-8
#interface for combining scripts
import os
#temp solution to find necessary combiner module
fudge = r'c:\python\merger'
os.chdir(fudge)
import combiner
# take input to fill path to files, header row & sheetname
print('Enter file location path')
path = input()
print('Enter number of row for headers in files...')
rowNum = int(input())
print('Are you combining sheets or workbooks?')
answer = input()
if answer.lower() == 'sheets':
print('enter filename including .xlsx')
file = input()
allSheets = combiner.sheet_list(path,file)
combiner.sheet_mix(path,file,rowNum,allSheets)
elif answer.lower() == 'workbooks':
print('Please enter name of sheet in files...')
sheet = input()
if sheet == '0':
sheet = 0
combiner.excel_mix(pathVar = path,startrow = rowNum,sheet = sheet)
else:
print('not an option, try again!')
#import combiner