I have several files, each of which has data like this (filename:data inside separated by newline):
- Mike: Plane\nCar
- Paula: Plane\nTrain\nBoat\nCar
- Bill: Boat\nTrain
- Scott: Car
How can I create a csv file using python that groups all the different vehicles and then puts a X on the applicable person, like:

Assuming those line numbers aren’t in there (easy enough to fix if they are), and with an input file like following:
Solution can be found here : https://gist.github.com/999481
Output:
Only thing this script doesn’t do is keep the columns in order that the names are in. Could keep a separate list maintaining the order, since maps/dicts are inherently unordered.