Table of Contents

Search

  1. Preface
  2. Introduction
  3. Dashboard
  4. Resources
  5. Workflows
  6. Task Reference
  7. Services Overview
  8. Users
  9. Logs and Reports
  10. Encryption
  11. System
  12. Appendix
  13. Glossary Terms

Example 1: Read CSV File

Example 1: Read CSV File

Follow the steps below to read a CSV file that trims the leading and trailing spaces and also takes a containing dollar figures and converts them to a standard number without formatting. The following image represents the input CSV file:
  1. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Read CSV task to the Project Outline.
  2. On the Basic tab of the Read CSV task, specify values for the Read CSV Task attributes:
    Input File
    The file path and file name of a single file from which to read the data.
    Output Row
    Set VariableThe name of a variable which will contain the data read from the specified input file.
  3. Click the
    Add
    button, and then click
    Specify Data Options
    .
  4. On the Data Options tab, specify the trim option, which is how the leading and trailing spaces will be trimmed.
  5. Click the
    Add
    button, and then click
    Add Column
    to add an element to the Read CSV task.
  6. On the Basic tab of the Column element, specify the Index value of the column (to perform type conversion for).
  7. On the Type Conversion tab of the Column element , specify the following attributes:
    TypeThe data type of this column. Use the value NUMERIC to convert the currency amounts into a standard number as per the example parameter above.
    Pattern
    The pattern to use to format numeric fields.
  8. Click the
    Save
    button when complete. When the project executes, a RowSet variable named myData will contain the following data. Note, the data format of ${myData[6]} has been updated to remove the currency format:
    ${myData} RowSet Variable
    ${myData[1]}
    ${myData[2]}
    ${myData[3]}
    ${myData[4]}
    ${myData[5]}
    ${myData[6]}
    34594
    Heather
    Banks
    1998-01-19
    BB001
    72000.00
    34593
    Tina
    Young
    2010-04-01
    BB001
    65000.00
    34590
    Kathy
    Harris
    2007-09-30
    KH001
    105000.00
    34592
    Mark
    Walker
    2012-11-15
    KH001
    87500.00
    34591
    John
    Davis
    2001-06-15
    KH001
    85000.00

0 COMMENTS

We’d like to hear from you!