Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 2.04 KB

README.md

File metadata and controls

9 lines (6 loc) · 2.04 KB

CSV to XLSX

This python program takes CSV files from one directory and copies their content, creates new XLSX files in a new directory, and populates it with the data from the CSV file.

Description

First the program starts by looping through the directory that contains your CSV files. As it loops, it gets the path for each individual CSV file as a string. The program uses this path to create a new path to the directory in which you want to save the new XLSX files. Next, the program opens each CSV files and copies the data of each row into an array. It then takes the path you created for your new XLSX file and opens it as an excel workbook. It then populates the new excel workbook with the array that contains the data from the CSV file. Lastly, there is a function to delete all the origional CSV files from their directory.

Usage

This program was designed to autommate converting to XLSX for when I scrape CSV files from the databases at work. Each day we scrape 15 Activity Reports with this program and 15 SO Reports with this program. I designed those programs to automatically rename each CSV file and move them out of my Downloads directory into another local directory on my computer. We have to rename each file to have more specfic er we scrappe both the Activity and SO Reports, we upload them to Google Sheets. Previously the company was doing this manually, but I figured out a way to completely automate this by connecting Google Drive to my Desktop. This prorgam puts the generated XLSX files into my shared Google Drive folder on my desktop. Also, the reason for converting the files from CSV to XLSX is because Google Sheets better integrates with XLSX files and importing CSV files directly causes unknown characters.