-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdfexcel easy 2.py
More file actions
38 lines (31 loc) · 882 Bytes
/
Copy pathdfexcel easy 2.py
File metadata and controls
38 lines (31 loc) · 882 Bytes
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
import openpyxl
wb = openpyxl.load_workbook('C:\\Users\\u\\Documents\\My Tableau Repository\\Datasources\\TradeClients.xlsx')
ws = wb['Clients']
data_rows = []
#for row in ws['A1':'T1000']:
count_row_ss=0
for row in ws:
count_row_ss = count_row_ss + 1
data_cols = []
for cell in row:
data_cols.append(cell.value)
data_rows.append(data_cols)
print ( count_row_ss )
print ( len(data_rows) )
for row in data_rows:
if 'Wholesaler' in row:
print (row[0:3])
ws = wb['Sheet1']
data_rows = []
#for row in ws['A1':'T1000']:
count_row_ss=0
for row in ws:
count_row_ss = count_row_ss + 1
data_cols = []
for cell in row:
data_cols.append(cell.value)
data_rows.append(data_cols)
print ( count_row_ss )
print ( len(data_rows) )
for row in data_rows:
print (row[0:3])