because the subtype and number of entities per user may vary.
(e.g. some have 'language' entity, others not)
I'm not that much an array wizzard to leave an intelligent patch at once here, but basically it has to be changed like that:
- read all rows into temporary array
- collect all available (subtype) array keys
- build up new array including all of these keys and build header row
- merge records of step 1 into array of step 3
- write to file