Using the Flat File Wizard

The Flat File Wizard creates a schema that defines the format of a flat file based on sample data that you provide. The Read Flat File activity uses this schema to convert flat files into an XML document.

For the best results, provide sample data that is like the actual data. For example, if the actual data contains header and footer rows, provide sample data with a header row for field names and footer rows. If the actual data contains quoted fields, the appropriate fields in the sample data should be quoted fields as well.

The Flat File Wizard only reads the first 1000 lines of a file. If the sample file contains more than 1000 lines and contains footer rows, remove lines before the footer rows so that the total line count stays within the 1000 line limit.
Important: All rows in your sample data must have the same number of fields.
To use the Flat File Wizard:
  1. From the Studio menus select Project > Flat File Wizard. The Flat File Wizard opens in a tab in the Studio workspace.
  2. Enter sample data into the Sample Data text box or click Browse... to load a sample file.
  3. Click Next >. The File Format page opens.
  4. Choose one of the file format options:
    • Character-delimited format (including Comma Separated Values format) - Choose this option when each line in the file has a record with fields separated by a single character, such as a comma or tab.
    • This file is in another format - Choose this option when your file does not meet the criteria of the previous file format option. If you select this option, you cannot use the Flat File Wizard to create a schema for your flat file.
  5. Click Next >. The Field Delimiters page opens.
  6. Select a field separator from the Fields separated by list. If you select Other:, specify the field separator in the field that displays to the right.
  7. If the field is enclosed by a specific character, select the character that encloses the field from the Fields enclosed by list. If you select Other:, specify the enclosing character in the field that displays to the right.
  8. Click Next >. The Header & Trailer page opens
  9. Specify whether header and trailer rows exist:
    1. Select Treat first row as header for field names, if a header row exists.
    2. Select Treat last __ row(s) as trailer, if a trailer row exists and specify the row number.
  10. Click Next >. The Edit Schema Name page opens.
  11. Enter a schema name.
    Tip: Choose a schema name that describes the data and file format.
  12. Click Finish. In the Project tab of the Studio Toolbox, the flat file schema you just created displays in the Flat File Schemas directory.
To read the flat file you created and convert it to XML:
  1. Add the Read Flat File activity to an orchestration.
  2. In the Checklist, select Configure. The Configure pane opens.
  3. In the Select a Flat File Schema field, specify the name of the flat file schema you have created.  
 To convert XML data to a flat file:
  1. Add the Write Flat File activity to an orchestration.
  2. In the Checklist, select Configure. The Configure pane opens.
  3. In the Select a Flat File Schema field, specify the name of the flat file schema you have created.