Recruitment homework question
This is one of the homework questions that Digitalbrain has recently been giving out to prospective candidates for a Linux system administrator role.
Working with a large, complex application with many thousands of users, we very often have to manipulate significant amounts of textual data. Perhaps as part of a process to create new student accounts within a school, or to feed to one of our management tools to delete or relocate a collection of user files, or maybe to collate data from one of the many log files.
So this question is based on the kind of work that is a core (if not very interesting) part of the role. I would have expected it to be a core part of any Linux sysadmins knowledge too.
The question:
Attached is a CSV file (a sample from a much larger file). This file needs cleaning and altering in the following ways:- * capitalise the first letter of the two name fields * sanitise the formatting * move the username column to the beginning of each line * the phone number is missing the area code - look up the city in the following table, and add it to the beginning of the phone number column
City | Area Code |
---|---|
London | 5 |
Brighton | 6 |
Manchester | 7 |
Please detail what you did, how, any scripts involved and provide the corrected CSV.
Our recent experience seems to suggest that being able to answer this is a rare skill, even for people who advertise themselves as experienced Linux system administrators (and are applying for such a job)!
Are we being unfair?
Are we expecting too much?