There are a couple of scripts external of KiCAD that do something similar to what you want..
This is a start: