In this tutorial you will read the modified films file and validate the genres field.
Create a new transformation.
Read the modified films file just as you did in the previous tutorial.
In the Content tab, check the Rownum in output? option and fill the Rownum fieldname with the text
rownum
.Do a preview. You should see this:
After the Text file input step, add a Regex Evaluation step. You will find it under the Scripting category of steps.
Under the Step settings box, select
Genres
as the Field to evaluate, and typegenres_ok
as the Result Fieldname.In the Regular expression textbox type
[A-Za-z\s\-]*(\|[A-Za-z\s\-]*)*
.Add the Filter rows step, an Add constants step, and two Text file output steps and link them as shown next:
Edit the Add constants step.
Add a
String
constant namederr_code
with valueGEN_INV
and aString
constant namederr_desc
with valueInvalid list of genres
.Configure the Text file output step after the Add...