import uuid import openpyxl from openpyxl.chart import BarChart, Series, Reference from openpyxl.chart.layout import Layout, ManualLayout def generate_testing_data(file_name): excel = openpyxl.Workbook() table = excel.active table.title = 'Latest List' table.cell(row=1, column=1, value='Count') table.cell(row=1, column=2, value='333') table.cell(row=2, column=1, value='ISIN list as of 29Jan') for row in range(3, 100): table.cell(row=row, column=1, value=str(uuid.uuid1())) excel.save(file_name) def extra_data_from_excel(excel_file_name): excel = openpyxl.load_workbook(excel_file_name) table = excel.get_sheet_by_name('Latest List') for row in range(3, table.max_row): cell = table.cell(row=row, column=1) if cell.value: print('[ISIN].[ISIN].[ISIN].[{}],'.format(cell.value)) if __name__ == '__main__': file_name = 'testing_excel.xlsx' generate_testing_data(file_name) extra_data_from_excel(file_name)