Defining Fields In a Delimited Input File
The Fields tab defines the names, position, and, for some file types, lengths, of the fields in the file. After you define an input file on the File Properties tab you can define the fields.
If the input file does not contain a header record, or if you want to manually define the fields, follow these steps on the Fields tab:
- To define the fields already present in the input file, click Regenerate. Then, click Detect Type. This will automatically set the data type for each field based on the first 50 records in the file.
- To add additional fields in the output, click Add.
- In the Name field, choose the field you want to add or type the name of the field.
-
In the Type field, you can leave the data type
as
string
if you do not intend to perform any mathematical or date time operations with the data. However, if you intend to perform these kinds of operations, select an appropriate data type. This will convert the string data from the file to a data type that will enable the proper manipulation of the data in the dataflow.Spectrum Technology Platform supports these data types:
- bigdecimal
- A numeric data type that supports 38 decimal points of precision. Use this data type for data that will be used in mathematical calculations requiring a high degree of precision, especially those involving financial data. The bigdecimal data type supports more precise calculations than the double data type.
- boolean
- A logical type with two values: true and false.
- bytearray
- An array (list) of bytes. Note: Bytearray is not supported as an input for a REST service.
- date
- A data type that contains a month, day, and year. For example, 2012-01-30 or January 30, 2012. You can specify a default date format in Spectrum Management Console.
- datetime
- A data type that contains a month, day, year, and hours, minutes, and seconds. For example, 2012/01/30 6:15:00 PM.
- double
- A numeric data type that contains both negative and positive double precision numbers between 2-1074 and (2-2-52)×21023. In E notation, the range of values is -1.79769313486232E+308 to 1.79769313486232E+308.
- float
- A numeric data type that contains both negative and positive single precision numbers between 2-149 and (2-223)×2127. In E notation, the range of values -3.402823E+38 to 3.402823E+38.
- integer
- A numeric data type that contains both negative and positive whole numbers between -231 (-2,147,483,648) and 231-1 (2,147,483,647).
- list
- Strictly speaking, a list is not a data type. However, when a field contains
hierarchical data, it is treated as a "list" field. In Spectrum Technology Platform a list is a collection of data consisting of multiple
values. For example, a field Names may contain a list of name values. This
may be represented in an XML structure
as:
It is important to note that the Spectrum Technology Platform list data type different from the XML schema list data type in that the XML list data type is a simple data type consisting of multiple values, whereas the Spectrum Technology Platform list data type is similar to an XML complex data type.<Names> <Name>John Smith</Name> <Name>Ann Fowler</Name> </Names>
- long
- A numeric data type that contains both negative and positive whole numbers between -263 (-9,223,372,036,854,775,808) and 263-1 (9,223,372,036,854,775,807).
- string
- A sequence of characters.
- time
- A data type that contains the time of day. For example, 21:15:59 or 9:15:59 PM.
-
If
you selected a date, time, or numeric data type, you can use the default date
and time or number format or you can specify a different format for this
specific field. The default format is either the system default format that has
been set in the type conversion options in Spectrum Management Console, or it is the
dataflow's default format specified in the type conversion options in Spectrum Enterprise
Designer. The format that is in effect is displayed. To use the default format,
leave Default selected. To specify a different format,
choose Custom and follow these steps:
Note: It is important that you choose a date and time format that accurately reflects the data you are reading from the file. For example, if the file contains date data in the format Month/Day/Year but you choose Day/Month/Year, any date calculations you perform in the dataflow, such as sorting by date, will not reflect the correct date. In addition, records may fail type conversion, in which case the failure behavior specified in the type conversion options in Spectrum Management Console or Spectrum Enterprise Designer will take effect.
- In the Locale field, select the country whose formatting convention you want to use. Your selection will determine the default values in the Format field. For date data, your selection will also determine the language used when a month is spelled out. For example, if you specify English the first month of the year would be "January" but if you specify French it would be "Janvier."
-
In the Format field, select the format for the data. The format depends on the data type of the field. A list of the most commonly used formats for the selected locale is provided.
An example of the selected format is displayed to the right of the Format field.
You can also specify your own date, time, and number formats if the ones available for selection do not meet your needs. To specify your own date or time format, type the format into the field using the notation described in Date and time patterns. To specify your own number format, type the format into the file using the notation described in Number Patterns.
-
In the Position field, enter the position of this field
within the record.
For example, in this input file, AddressLine1 is in position 1, City is in position 2, StateProvince is in position 3, and PostalCode is in position 4.
"AddressLine1"|"City"|"StateProvince"|"PostalCode" "7200 13TH ST"|"MIAMI"|"FL"|"33144" "One Global View"|"Troy"|"NY"|12180
- If you want to have any excess space characters removed from the beginning and end of a field's value string, select the Trim check box.