Excel- How to combine CSV files using Python

  Рет қаралды 412

Eamonn Cottrell

Eamonn Cottrell

Күн бұрын

Пікірлер: 3
@lizzybennet5726
@lizzybennet5726 4 күн бұрын
Thanks so much for this! Dumb question, but wouldn't I have to edit the code slightly so this would work on sheets saved on Google Drive?
@EamonnCottrell
@EamonnCottrell Күн бұрын
Yes, it would need to be altered for Apps Script. You'd put all the csv files in a folder on your google drive, get that folder ID and then use this apps script: function combineCSV() { const folderId = ''; // Replace with the folder ID where your CSVs are stored const folder = DriveApp.getFolderById(folderId); const files = folder.getFilesByType(MimeType.CSV); const ss = SpreadsheetApp.getActiveSpreadsheet(); while (files.hasNext()) { const file = files.next(); const csvData = Utilities.parseCsv(file.getBlob().getDataAsString()); const sheet = ss.insertSheet(file.getName()); sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData); } }
@lizzybennet5726
@lizzybennet5726 Күн бұрын
@EamonnCottrell Thanks so much! I have some knowledge of AppsScript. It's been a life saver at work.
Stop manual work in Excel with this blueprint.
11:13
Excel Off The Grid
Рет қаралды 10 М.
UV for Python… (Almost) All Batteries Included
17:35
ArjanCodes
Рет қаралды 86 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Modern Python logging
21:32
mCoding
Рет қаралды 212 М.
Windsurf vs Cursor: which is the better AI code editor?
8:11
Steve (Builder.io)
Рет қаралды 35 М.
Zed Text Editor. A VSCode alternative?
15:51
Infralovers GmbH
Рет қаралды 10 М.
The SIMPLEST Way to Organize Your Files and Folders
10:14
Lea David
Рет қаралды 261 М.
How To Use Yazi: An Awesome Terminal File Manager Written In Rust
22:05
Python Tutorial: CSV Module - How to Read, Parse, and Write CSV Files
16:12
I Finally Tried The AI-Powered VS Code Killer | Cursor IDE Review
8:52
Your Average Tech Bro
Рет қаралды 111 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 821 М.