Hi,
I have a file with about 150 fields of data (columns) and a row per ID. Some fields contain codes which map to a text label (others don't). I have the text labels in a separate csv file but this is flattened data and all the codes are stacked. Is there anyway of joining the two files and adding the labels as new fields at the end of the original file (see below for a simple example). I am trying to avoid doing 150 separate joins and I am sure there must be a better (much more efficient) way using transpose or another tool but I don't know how.
| ID | Gender | Colour | Age_group |
| ID_1 | 1 | 1 | 1 |
| ID_2 | 2 | 2 | 3 |
| ID_3 | 1 | 3 | 2 |
| FieldName | Code | Label |
| Gender | 1 | Male |
| Gender | 2 | Female |
| Colour | 1 | Blue |
| Colour | 2 | Pink |
| Colour | 3 | Yellow |
| AgeGroup | 1 | Under 20 |
| AgeGroup | 2 | 20-30 |
| AgeGroup | 3 | Over 30 |
| ID | Gender | Colour | Age_group | Gender_Label | Colour_Label | AgeGroup_Label |
| ID_1 | 1 | 1 | 1 | Male | Blue | Under 20 |
| ID_2 | 2 | 2 | 3 | Female | Pink | Over 30 |
| ID_3 | 1 | 3 | 2 | Male | Yellow | 20-30 |