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 Excel Task

Example 1: Read Excel Task

Follow the steps below to read an Excel document and format a date column.
  1. From within the Project Designer page, expand the Data Translation folder in the Component Library, and then drag the Read Excel task to the Project Outline.
  2. On the Basic tab of the Read Excel task, specify values for the following attributes:
    Input File
    The file path and file name of an Excel document from which to read data.
    Output RowSet Variable
    The name of a variable to contain the data read from the Excel document.
  3. On the Advanced tab of the Read Excel task, specify values for the following attributes:
    Data Start Row Number
    The row number where the data starts in the document. In the example above, the Data starts on row four (4).
    Headings Row Number
    The row number where the column headings are found in the document.
  4. Click the
    Add
    button and click the
    Specify Data Options
    option.
  5. Click the
    Add
    button and click the
    Add Column
    option.
  6. On the Basic tab of the Column element, specify the Index value:
    Index
    The index of the column in the document.
  7. On the Type Conversion tab of the Column element, specify values for the following attributes:
    Type
    The data type of this column. In the example above the data type is DATE.
    Pattern
    The pattern to use to format numeric or date/time fields. The pattern is automatically determined based on ISO formatting. Only specify the pattern if ISO date format is not desired.
  8. Click the
    Save
    button when finished.
When the project executes, a RowSet variable named myData will contain the following data:
${myData} RowSet Variable
${myData[1]}
${myData[2]}
${myData[3]}
${myData[4]}
${myData[5]}
${myData[6]}
ID
First Name
Last Name
Hire Date
Dept Code
Wages
34594
Heather
Banks
1998-01-19
BB001
72000
34593
Tina
Young
2010-04-01
BB001
65000
34590
Kathy
Harris
2007-09-30
KH001
105000
34592
Mark
Walker
2012-11-15
KH001
87500
34591
John
Davis
2001-06-15
KH001
85000
The Read Excel Task will ignore any formatting such as alignment options, size, and font family. Also, formulas are processed before they are read, so if a cell contains the formula of =SUM(A1:A10), then the value will be read as the sum of the cells A1 through A10.

0 COMMENTS

We’d like to hear from you!