Advanced Text Layout

You can use an Advanced Text file to define the structure of your Source or Destination layout. An Advanced Text file refers to a text file that can have multiple record formats and field separators. To create an Advanced Text File Layout, you need to specify the format of the text file.

Follow the steps below to create an advanced text layout using the default option:

  1. Click Configure > LAYOUTS > Advanced Text.
  2. Click Create Advanced Text Layout.
  3. On the Create Layout screen, select the Default option from the Select Layout UI Type field.
  4. Click Next. 
  5. On the Create Layout screen,



    1. In the Name and Description fields, type the name and description of the new advanced text layout.

      Name: Only alphanumeric and underscore are allowed and you must start the layout name with an alphabet or underscore.
      Description: Only alphanumeric and few special characters(_ - . : , @ $ ? \\ and space) are allowed and you must start the description with an Alphabet/Underscore/Number.
    2. In the Definition Mode field, select either Import Definition File or Enter the Fields Sequentially option.
    3. In the Identifier Field, select either First Field or Define Field.

      • If you select First Field, the first field of the record is considered as the record identifier.
      • If you select Define Field, you can specify a field that you want to use as the record identifier.
    4. In the Record Separator field, provide the record separator, for example, \n for new line and \s for space. The record separator is used to separate the records.
    5. In the Field Separator field, provide the field separator, for example, \t for Tab and \s for space. Field Separator is used to separate fields.

      • You can specify multiple records and field separators. You can also use regular expressions to specify field separators. For example, you can use "\s:" to specify space or colon ( : as a field separator.

      • You can not directly use special characters such as '', '', or '|' in your regular expression as field separators. To use them you need to put these characters within square brackets in the *Field Separator field. For example, [], [*] or [|].
      • However, if you use the same layout at the target end, in a target data file then the layout will print the field separator along with the square brackets. To avoid this, enter '+', '', or '|' in the *Target Field Separator field in Advanced Properties.
      • You can also use hex values in record and field separators. 
        • As field separator at target end, use 0x before the value. For example, for space as field separator use 0x20.
        • As field separator at source end, use as regular expression. For example, for space as field separate or use \x20 .
        • Record separator uses regular expression to support hex values at both source and target end. For example, for space as a record separator, use 0x20 .
      • You can also specify two hex values together in record and field separator. For example, for two spaces you need to use 0x200x20.
    6. To define the layout using the Import Definition File option, follow the steps below:
      1. In the Definition File field, select the definition type (XSD).

      2. Click Choose File, navigate to and select the required file (XSD), and then click Open to upload.

    7. To define the layout using the Enter the Fields Sequentially option, follow the steps below:
      1. Enter the record identifier in the Record Identifier field. You can also use a regular expression in this field.
      2. Enter a name in the Field Name field.

        You can use spaces and other special characters (~`! @ # $%^&*() {} [] | \\ : ; " ' - + =<> / ? . ,  ) in the field names. The special characters are rendered as underscores (__) if you use this layout in a Mapping.

      3. In the Match Pattern field, enter the pattern against which you want to match the record.

        You can use regular expression in the Match Pattern field. For example, if in the data file there is a Company Name field that can have value like XYZ SYSTEMS, INC. Since you can use \S as a field separator, the layout will consider XYZ, SYSTEM, and INC as separate fields. But they need to be a part of the same field. To parse this type of data, you can enter \S+ .* (INC\.|INC(ORPORATED)?) in the Match Pattern field. This pattern matches the fields that have spaces and end with INC. or INCORPORATED.
      4. Enter a particular pattern that you want to skip in the Skip Pattern field. You can also use regular expression in this field.

      5. Enter the minimum and maximum size of the field in the Min Size and Max Size fields respectively.

        The Min Size and Max Size fields in the Advanced Text Layout have predefined/default values of the character count. You can change these default values based on your requirement.
      6. Enter the position in the Position field.
      7. Click the Add Record button to define another type of record format and follow the steps from ii through vi.


        For adding more fields in the same record format, click the Add Row button.
        Specify the number and position of the rows that you want to add, in the Number of Rows and Position fields respectively and click the Add Row button to insert rows. You can add a maximum of 99 rows at a time.

        Advance text layout supports only String data type.

        You can enable quotes handling, by checking the Quotes Handling on check box in the Advanced Properties.

        For example, if there is a field data record, "Chocolate$20$perpack" and you set a field separator as $ then the layout will ignore the $ even though it's a part of the data.
        To avoid such situations you need to put that field within double quote like this, (Chocolate"$"20$perpack").

        When you use Quotes Handling on in a layout then regular expression does not work on any field.
        The header contains the information about the different record structure of the text file. You may not want to send the header information to the target. To do this, you need to check the Ignore Header check box in Advanced Properties. You can use this property only when you use a layout at the source end. This property is not applicable while use it at a target layout.

        If there are multiple record separators in an input file, then to parse this input file, you need to check the Look Ahead check box in the Advanced Properties.

        At times, the input data may contain some characters that are invalid in XML, this results in the abortion of the mapping process. You can filter these invalid XML characters by checking the Filter Invalid XML Characters check box in Advanced Properties.

      8. After defining records you need to define their hierarchy. This is mandatory for creating an Advance Text layout.
      9. Once you finish adding the records and defining their record identifiers, click the Refresh button under the Hierarchy Definition. This action will populate the record identifiers in the Record ID field. 

      10. Select a record from the Record ID list box.
      11. Select Y or N from the required list box, to indicate if you want the current record to be present in the source file.
      12. In the minoccur field, enter the minimum number of occurrences of the current record that you want in the source file. The minimum allowable value is 1.
      13. In the maxoccur field, enter the maximum number of occurrences of the current record that you want in the source file. The maximum allowable value is 2147483647.

        You can create a record either at the root level or at the child level.
      14. Expand the Advanced properties:
        1. In the Character Set Encoding field, enter the required character set encoding.
        2. In the Target Field Separator field, enter the target field separator value. It helps to separate the data fields in a data record.
        3. Select Quotes Handling check box to enable quotes handling.
        4. When using Text layout at the target side, select the  to enclose the target field values in double quotes. For example, "John","Smith".
        5. 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 layout.

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

          • When you select the Allow Less Field check box then layout generates an empty tag for fields that are not present in the data file.
          • This option is applicable only when you use the layout at the source end.
        6. Select Remove Last New Line Record Separator check box if you want to remove the new line record separator from the target file.
        7. Select the Ignore Header check box if you want the header line in the data file is to be ignored.

        8. Select the Look Ahead check box if the data file has new line or multiple new line to separate the fields. 

        9. Select the Singe Record Type check box if the data has one record type and record identifier is not fixed.
        10. 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 check box.
        11. Select Ignore Empty Records to ignore a record that does not hold any value in any of its fields, including the record identifier.
        12. Select the Filter Record Identifier At Target check box if you want to skip the record identifier in the target file. 
        13. In the Project field, select the project.
      15. Click Save.

Using Record at Root Level

  1. Click the Add Root Record.
    This action will create a record at the same level as that of the current record.
  2. Select a record from the Record ID field of the current record and enter all the information.

    Select a record from the Record ID list box of the root record and repeat step 1-2 to create another root Record.

    Each root Record must have a unique Record ID. For example, if you select [0-9][8,8]+[D] as the first root record, then you need to select Agent in the next root record.


    Using Record at Child Level


  1. Click the Add Child.
    This creates a record at a level below that of the current record.
     

  2. Select a record in the Record ID list box of the current record and enter all the information.
  3. Select a record from the Record ID list box of the root record and repeat step 1-2 to create a child record.

    A parent and child record must have a unique Record ID in one hierarchy. For example, if you select [0-9][8,8]+[D] as the parent record, then you need to select Agent as the child record. Similarly, if you create another child record under Agent, then you need to select Officer as its Record ID.
    Select a record and click the Remove button to remove it. This will display a confirmation delete message, click OK to delete the record.
    Alternately, if you delete the last field name of a record and then save the layout, this action will delete the entire field. For example, a record has three fields – Name, Description, and Age. If you delete Age, save the layout, this action will delete the entire field.
    If a record has one or more child record, deleting the parent record will delete all its child record too.
  4. Click Save.