
Splitting One Excel Sheet Into a Workbook per Group
Split one Excel sheet into a workbook per region or customer with pandas groupby, safe file names, formatting, a manifest and checks that the parts add up.
Tag
40 posts

Split one Excel sheet into a workbook per region or customer with pandas groupby, safe file names, formatting, a manifest and checks that the parts add up.

Combine hundreds of Excel files into one table with Python: glob, read each sheet, check headers, add the source name, quarantine bad files and verify counts.

Build a weekly Excel report with Python: query the database, write the workbook, email it and schedule it with cron, with paths, logs, locks and failures.

Office Scripts automate Excel on the web with TypeScript. Record an action, edit the code, run it from Power Automate on a schedule, and know its limits.

Run Python from an Excel button with xlwings: install, quickstart, RunPython and RunPython, read and write ranges, user defined functions and the limits.

Compare VBA and Python for automating Excel by where the code runs, what it can touch, how it is tested and who maintains it, with a rule for choosing.

A cron job that writes a daily CSV report from SQL: wrapper script, atomic output, a lock against overlap and the environment traps that bite at 2 a.m.

Capture every row an import refuses, with its line, column and reason, in a form a person can fix and replay. A DuckDB example with real reject tables.

A provider adds, renames or reorders columns and your load breaks or, worse, succeeds. A header check that names the change, aliases and a policy per case.

Load small reference CSVs with dbt seeds from version control, set column types so zip codes keep their zeros, and learn when seeds are the wrong tool.

Load a daily CSV in Airflow with one plain Python task instead of a chain of operators: idempotent by date, safely retried and testable outside Airflow.

Poll a folder for new CSV files and import each only once it has stopped changing. Why file events fire too early, a stable-file watcher and inotify on Linux.