Jul-16-2019, 12:04 AM
Realized I wasn't opening file thought maybe that was cause of it...but still didn't work
rows = [] mode = 'nowhere' with open('PYTHON GDL Resources.txt', 'r') as file: for line in file: if line: if mode == 'nowhere': mode = 'header' header_data = [] # resets the header info for each new section elif 'Access' in line: if 'No users with' in line: continue mode == 'access' if mode == 'header': # pull out header information and put it into header_data elif mode == 'Access': access_type, users = line.split(':') # everything after the colon for user in users.split(','): rows.append(header_data + [user.strip(), access_type.strip()]) else: mode = 'nowhere' # start looking for new section