We saw in Chapter 3, Transforming Files, in the StateLookup
job example, that we can use the Studio to replace one value with another. In this example, we used a second reference data source and a tJoin
component to take a value from the input file and replace it with the value held in the reference file (replacing the long-form of the state name with its two-character state code). This works really well if the replacement data is held in a reference file or database. However, sometimes we won't have this data stored elsewhere or the nature of the lookup is not as well structured as our state code example. In these instances, we can use a simple find and replace component to apply ad-hoc lookups. Let's see this technique in action.
In this job, we will take a list of two-character country codes and replace one of them with the full country name. Our input file is country-codes.csv
in the resource directory of this chapter.
Create a new job and name it
FindAndReplace
.Create...