SHARE
TWEET

help

a guest Jan 21st, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. units_and_local_workbook = load_workbook(filename='teams.xlsx')
  2.     for sheets in units_and_local_workbook:
  3.         unit_sheet = units_and_local_workbook.get_sheet_by_name(sheets.title)
  4.         for value in unit_sheet.iter_rows(min_row=3, min_col=1, max_col=1, values_only=True):
  5.             string_out = str(value)
  6.             unit_number = re.findall(r'\d+', string_out)
  7.             if unit_sheet.title == 'Eastern Unit':
  8.                 eastern_unit.append(int(unit_number[0]))
  9.             if unit_sheet.title == 'Eastern Local Team':
  10.                 eastern_local_teams.append(int(unit_number[0]))
  11.             if unit_sheet.title == 'Mid West Unit':
  12.                 mid_west_unit.append(int(unit_number[0]))
  13.             if unit_sheet.title == 'Mid West Local Team':
  14.                 mid_west_local_teams.append(int(unit_number[0]))
  15.             if unit_sheet.title == 'North East Unit':
  16.                 north_east_unit.append(int(unit_number[0]))
  17.             if unit_sheet.title == 'North East Local Team':
  18.                 north_east_local_teams.append(int(unit_number[0]))
  19.             if unit_sheet.title == 'North West Unit':
  20.                 north_west_unit.append(int(unit_number[0]))
  21.             if unit_sheet.title == 'North West Local Team':
  22.                 north_west_local_teams.append(int(unit_number[0]))
  23.             if unit_sheet.title == 'South East Unit':
  24.                 south_east_unit.append(int(unit_number[0]))
  25.             if unit_sheet.title == 'South East Local Team':
  26.                 south_east_local_unit.append(int(unit_number[0]))
  27.             if unit_sheet.title == 'South West Unit':
  28.                 south_west_unit.append(int(unit_number[0]))
  29.             if unit_sheet.title == 'South West Local Team':
  30.                 south_west_local_teams.append(int(unit_number[0]))
  31.             if unit_sheet.title == 'West Central Mid Unit':
  32.                 west_central_midlands_unit.append(int(unit_number[0]))
  33.             if unit_sheet.title == 'West Central Mid Local Team':
  34.                 west_central_midlands_local_teams.append(int(unit_number[0]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top