diff --git a/excel_to_csv/README.md b/excel_to_csv/README.md new file mode 100644 index 000000000..c1037d190 --- /dev/null +++ b/excel_to_csv/README.md @@ -0,0 +1,3 @@ +### Excel to CSV + +Run the script excel_to_csv.py the script will ask for the location of the Excel file and will store it inside the folder of the script. diff --git a/excel_to_csv/excel_to_csv.py b/excel_to_csv/excel_to_csv.py new file mode 100644 index 000000000..dd22afd00 --- /dev/null +++ b/excel_to_csv/excel_to_csv.py @@ -0,0 +1,14 @@ +import openpyxl +import csv + +print("Enter Path of your Excel file") +xls_file = input() +csv_file = 'mycsvfile.csv' +mode = 'w' + +wb = openpyxl.load_workbook(xls_file) +sh = wb.active +with open(csv_file, mode, newline="") as f: + col = csv.writer(f) + for row in sh.rows: + col.writerow([cell.value for cell in row]) diff --git a/excel_to_csv/requirements.txt b/excel_to_csv/requirements.txt new file mode 100644 index 000000000..add082e0d --- /dev/null +++ b/excel_to_csv/requirements.txt @@ -0,0 +1,3 @@ +certifi==2021.5.30 +et-xmlfile==1.1.0 +openpyxl==3.0.9