Last active
May 25, 2022 10:55
-
-
Save CEZERT/aa17a783339e3eed41b7e08e5e5e15e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CSV to XLS python | |
import pandas as pd | |
import os | |
from tkinter import Tk, filedialog | |
import glob | |
from pathlib import Path | |
root = Tk() | |
root.withdraw() | |
root.attributes('-topmost', True) | |
open_folder = filedialog.askdirectory() | |
print(open_folder) | |
for (filename) in glob.glob(open_folder + '/*.csv'): | |
handle = pd.read_csv(filename, delimiter = ';') | |
handle.to_excel(open_folder +'/'+ Path(open_folder + '/' + filename).stem + '.xls', index = False, header = False) | |
print(Path(open_folder + '/' + filename).stem + '.xls') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment