Download Templates Guide

Transcript
Parsing U.S. Phone Numbers
Parsing U.S. Phone Numbers
This template demonstrates how to parse U.S. phone numbers into component parts. The parsing rule
separates each token in the PhoneNumber field and copies each token to four fields: CountryCode,
AreaCode, Exchange, and Number.
Template name: ParseUSPhoneNumbers.df
Sample input file name: PhoneNumbers.csv
Sample output file name: ParsePhoneNumbers-Output.csv
Modules required: Data Normalization Module
Business Scenario
You work for a wireless provider and have been assigned a project to analyze incoming phone number
data for a growing region of your business.
Solution
The following dataflow provides a solution to the business scenario:
In this dataflow, data is read from a file and processed through the Open Parser stage. For each data
row in the input file, this data flow will do the following:
Read from File
This stage identifies the file name, location, and layout of the file that contains the phone numbers you
want to parse.
Open Parser
This stage defines whether to use a culture-specific domain grammar created in the Domain Editor or
to define a domain-independent grammar. A culture-specific parsing grammar that you create in the
Domain Editor is a validated parsing grammar that is associated with a culture and a domain. A
domain-independent parsing grammar that you create in Open Parser is a validated parsing grammar
that is not associated with a culture and domain. For more information about the two types of parsing
grammars, see the Spectrum™ Technology Platform User's Guide.
In this template, the parsing grammar is defined as a domain-independent grammar.
The Open Parser stage contains a parsing grammar that defines the following commands and expressions:
62
Spectrum™ Technology Platform 8.0.0 SP3