Skip to content

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.

Notifications You must be signed in to change notification settings

watson-clara/CSV-to-XLSX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages