plobsing, your suggestion improves readability, but the code is still directly tied to the data file and its internal representation. Consider this scenario:
1. You write a piece of code tied to the data representation.
2. You leave the company.
3. It becomes very popular.
4. Dozens of people want to use it, but they want to each make lots of small changes to the data representation. Rather than rewriting the code to handle all cases, they cut and paste unique versions of the code and change the constant mapping to fit their unique cases.
And all I'll say is, I've been there, at step 5, when someone gets asked to refactor all those scripts into 1 script.
So I beg to differ: as long as your code is tied directly to data representation, it isn't as good as indirect solutions, where the representation can be modified without affecting running code.
Update: typo fix