Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # importe required libraries
- import openpyxl
- import csv
- import pandas as pd
- # open given workbook
- # and store in excel object
- excel = openpyxl.load_workbook("qr_names_input.xlsx")
- # select the active sheet
- sheet = excel.active
- # writer object is created
- col = csv.writer(open("qr_names_input.csv",
- 'w',
- newline=""))
- # writing the data in csv file
- for r in sheet.rows:
- # row by row write
- # operation is perform
- col.writerow([cell.value for cell in r])
- # with open("qr_names_input.csv", "r") as f:
- # rows = f.readlines()[1:]
- # print(rows)
- # with open('qr_names_input.csv', 'w') as fout:
- # fout.writelines(rows)
- # import pandas as pd
- # read_file = pd.read_excel (r'qr_names_input.xlsx', sheet_name='Sheet1', engine='openpyxl')
- # read_file.to_csv (r'qr_names_input.csv', index = None, header=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement