Creating Text Schema Activity

Text Schema is used to define how Adeptia Suite reads from or writes to a text file in a predefined format. To create a Text Schema activity, you need to specify the format of the text file.

Steps to create a Text Schema Activity

  1. Go to Develop > Services > Schema > Text. 



  2. Click Create New to create a new Text Schema.

  3. Type the name and description of the new text schema in the Name and Description text boxes.
  4. Select Data Header Present check box if the data header is present in the text file. Data Header usually contains the titles of the fields in a text file. 
  5. Provide the record separator, for example, \n for newline or " " for space, in the Record Separator. The record separator is used to separate the records.
  6. Provide the field separator, for example, \t for Tab or " " for space, in the Field Separator. Field Separator is used to separate fields.

  7. Select the mode to define the file. 
    To define the schema using definition file, select Import Definition File and do the following:
    1. Select the type from the drop-down list and click Upload File to select the required file. The Schema File Upload window appears.
    2. Browse to and select the file. 
    3. Click Upload File to upload the selected the file. Name of the uploaded file is shown in the File Name list.
    4. Click Finish to close the window and return to the schema screen.


    To define the schema by entering the fields manually, select Enter the Fields Sequentially and do the following:
    1. Enter the name of each field in the Field Name field. 

    2. Select the type of data from the Type drop-down list. Following are the options - string, number, and date. If the data type is Date, select the format of date and time from the Date Format and Time Format drop-down lists.

      To insert rows, specify the number and position of the rows to add in the Number of Rows and at Position and click Add Row. You can add a maximum of 99 rows at a time.

      To remove rows, specify the number and position of the rows to delete in the Number of Rows and at Position and click Remove Row.

      If you delete the last record and save the schema, this action will delete the entire field. For example, a record has three fields – Name, Description, and Age. If you delete Age then schema will delete the entire fields.

       

  8. Expand Advanced Properties.

  9. Change the default character set encoding to the required character set encoding.
  10. Dynamic Header Support check box is an advanced feature of Text Schema, which is used to parse an excel or text file, if:
    FieldNames defined in the source schema and the Data Headers (Column Name) of the excel/text file are same but not in the same order.
    FieldNames defined in the source schema and the Headers of the excel/text file are not same. They may or may not be in the same order.

    If the headers are not matched between Schema Definition and Source File then XML (output of schema) will only have Root rather than any Record entry. For instance, if the headers of the source schema are Id, Name, and Age and the headers of the data file are Emp Id, Emp Name, and Emp Age then the output of the schema will be blank.                     

    On selecting the Dynamic Header Support check box, Allow Ignore case check box appears. Select this check box to ignore the casing mismatches in the header of the schema and the data file.

  11. Select Quotes Handling check box to enable quotes handling.

  12. When using Text schema at the target side, select the  to enclose the target field values in double quotes. For example, "John","Smith".

  13. Select Remove Last New Line Record Separator check box if you want to remove the new line record separator from the target file.
  14. Select Allow Less Fields check box to process the data in case the number of fields in the data file is less than the number of fields defined in the schema.

    • When the number of fields in the data file is less than the number of fields defined in the schema then schema will not process the data and give an error during execution.

    • When you select the Allow Less Field check box then schema generates an empty tag for fields that are not present in the data file.
    • This option is applicable only when you use the schema at the source end.
  15. In case the input data contains some characters that are invalid in XML then this may result in the aborted mapping. You can filter these invalid XML characters by selecting the Filter Invalid XML Characters checkbox.

  16. Type the enclosing characters to remove from the data file while parsing in the Handle Enclosing Character. Currently, following enclosing characters are supported:
    • Single Quote (')
    • Double Quote (")
    • Less than symbol (<)
    • Greater than symbol (>)

    Note: Handling Enclosing Character is supported for source schema only. If Quotes Handling is checked true, the value of data file at the target schema will be appended with the enclosing character.

    To learn about Advanced Properties refer to Changing Advanced Properties.

  17. Click Save to save the new Text schema.