Data · VBA
Extracteur INSEE — Ville de Lyon
A census file is millions of encoded rows to translate and lay out.
What I did
- Extraction by area. Import from the census files — both individuals and dwellings — filtered by IRIS, town or canton code, walking the file line by line rather than loading it into memory.
- Composite areas. Extraction by EPCI or by Lyon district, cross-referencing INSEE's geographic-membership tables to resolve the towns and cantons involved.
- Variable decoding. A dictionary built in a single pass over the variable table, keyed by variable code plus modality code, then substituted column by column.
- The format traps. Two dedicated functions: one converts the UTF-8 labels, unreadable as-is in Excel; the other strips leading zeros from modality codes, without which the dictionary keys never match.
- The documentation. A manual covering every procedure, the workbook structure and the common errors — the tool had to stay usable by the department after I left.
Stack
VBAExcelCSVDonnées INSEE