Reading data profiling XML results with the Script task
In this recipe, you will read the XML file produced by the Data Profiling task and use the Script task to read the regular expressions extracted and store them in package variables.
Getting ready
This recipe assumes that you have finished the first recipe of Chapter 5,Dealing with Data Quality, and have the results of the Data Profiling task at your hand.
Note
For your convenience, the results of the Data Profiling task needed for this recipe are provided in the DataProfiling.xml
file.
How to do it...
- Add a new package to the
AdventureWorksETL
project. Rename the default packageRegExValidation.dtsx
. - Create two package variables. Name them
EmailRegEx1
andEmailRegEx2
. Use theString
data type for both variables. - Drag the Script task to your control flow. Rename it
ReadPatterns
. - Open the editor for this task. On the Script page of the Script Task Editor, make sure that the Visual C# language is selected. Add the
User::EmailRegEx1
andUser::EmailRegEx2...