> For the complete documentation index, see [llms.txt](https://docs.oneweb.tech/oneweb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oneweb.tech/oneweb/reference/process-designer-reference/process-designer-component/activity-nodes/file-read.md).

# File Read

Use the **File Read** task to get information from a file. It is represented as rectangular shape box as shown below:

![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FAK24DGTh7lH4v1i26ljN%2F0?alt=media)

**Purpose**

The **File Read** task is used to read information from file. When your process flow requires to access information from a file, user can use **File Read Task** to read the data. The "**File Read" Node Task** supports files from many sources and different formats.

**File Node Configuration Properties**

Configurations property settings panel has 3 tabs to define properties.

**General**

General Tab contains general information such as title name, task id, description etc.

**BusinessObject**

Used to configure and map the **Business Object** for input and output for the node.

**File Read Parameter**

![](https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FyCc8k5YynzdeJ8adis9V%2F1?alt=media)

All Settings in File Read Parameter Tab are shown below:

| **Property**                | **Mandatory** | **Default** | **Description**                                                                            |
| --------------------------- | ------------- | ----------- | ------------------------------------------------------------------------------------------ |
| File Source                 | Y             | -           | The format type for the file transfer, like File system, FTP, Secured FTP (SFTP) and FTPS. |
| File Type                   | Y             | -           | The format type of the metadata files, namely FIXWIDTH, XLS, DELIMITED, and XML.           |
| Skip 1st Row                | N             | Off         | The value is used to skip first row of a file.                                             |
| Remove Duplicate Records    | N             | Off         | The value is used to remove duplicate records in a file.                                   |
| Apply Filter                | N             | Off         | The value is used to filter the data.                                                      |
| Apply Sort                  | N             | Off         | The value is used to sort data in file.                                                    |
| Transform Fields            | N             | Off         | The value is used to convert data to desired type.                                         |
| Move File After Compilation | N             | Off         | The value is used to move the file to do something when reading is success or failure.     |

The values for **File Source** can be as following: **File System, FTP, Secured FTP (SFTP)** and **FTPS**. When value for **File Source** is selected, user must enter information for **File Source**.

**File System**

Select **File System** to read file from computer directory.

| **Property**   | **Mandatory** | **Default** | **Description**                                |
| -------------- | ------------- | ----------- | ---------------------------------------------- |
| Path Directory | Y             |             | The path or the directory that keeps the file. |
| File Name      | Y             |             | The name of the file to be used.               |

**File Transfer Protocol (FTP)**

**FTP** is the standard network protocol used to transfer of computer files between a client and server on a computer network.

| **Property**   | **Mandatory** | **Default** | **Description**                                                   |
| -------------- | ------------- | ----------- | ----------------------------------------------------------------- |
| IP Host        | Y             |             | The value of the ftp host address for transferring files.         |
| Port           | Y             |             | The value of the ftp location for transferring files.             |
| Passive Mode   | N             | Uncheck     | To connect the protocol ftp with passive mode.                    |
| Username       | Y             |             | The username for logging in to the ftp host.                      |
| Password       | Y             |             | The password for logging in to the ftp host.                      |
| FTP Repository | Y             |             | The path for keeping the ftp file as back up.                     |
| Expression     | Y             |             | The value that was defined is the condition for showing the data. |
| Suffix         | N             |             | The value is the extension of the ftp.                            |

**Secured File Transfer Protocol (SFTP)**

**SFTP** is the standard data transmission protocol for use with the SSH2 protocol. It assures that information is securely transferred using safe information stream.

| **Property**   | **Mandatory** | **Default** | **Description**                                                   |
| -------------- | ------------- | ----------- | ----------------------------------------------------------------- |
| IP Host        | Y             |             | The value of the sftp host address for transferring files.        |
| Port           | Y             |             | The value of the sftp location for transferring files.            |
| Username       | Y             |             | The username for login to the sftp host.                          |
| Password       | Y             |             | The password for login to the sftp host.                          |
| FTP Repository | Y             |             | The path for keeping the sftp file was backed up.                 |
| Expression     | Y             |             | The value that was defined is the condition for showing the data. |
| Suffix         | N             |             | The value is the extension of the sftp.                           |

**File Transfer Protocol Secured (FTPS)**

**FTPS** is an extension to the commonly used **File Transfer Protocol (FTP)** that support for the Transport Layer Security (TLS) and the Secure Sockets Layer (SSL) cryptographic protocols.

| **Property**   | **Mandatory** | **Default** | **Description**                                                   |
| -------------- | ------------- | ----------- | ----------------------------------------------------------------- |
| IP Host        | Y             |             | The value of the ftps host address for transferring files.        |
| Port           | Y             |             | The value of the ftps location for transferring files.            |
| Implicit SSL   | N             | Uncheck     | To connect the protocol ftps with Implicit SSL mode.              |
| Username       | Y             |             | The username for logging in to the ftps host.                     |
| Password       | Y             |             | The password for logging in to the ftps host.                     |
| FTP Repository | Y             |             | The path for keeping the ftps file as back up.                    |
| Expression     | Y             |             | The value that was defined is the condition for showing the data. |
| Suffix         | N             |             | The value is the extension of the ftps.                           |

The values for **File Type** can be **FIXWIDTH, XLS, DELIMITED** or **XML.** When value on **File Type** is selected, user must also enter information about that **File Type.**

**FIXWIDTH**

This format support data where every field has a fixed width and for width those fields is less than the value.

| **Property**     | **Mandatory** | **Default** | **Description**                            |
| ---------------- | ------------- | ----------- | ------------------------------------------ |
| Non Uniform Rows | Y             | Off         | To indicate if the file has varying widths |

When **FIXWIDTH** is selected on **File Type**, user can choose **Non Uniform Rows** as **"on"** or **"off".** If set to **"on"**, then user must also enter information for **Non Uniform Rows** and **Non Uniform Rows** is set to **"off"** when a file has consistent width for all rows.

| **Property**     | **Mandatory** | **Default** | **Description**              |
| ---------------- | ------------- | ----------- | ---------------------------- |
| Number of Header | Y             | 1           | Number of field Header.      |
| Field            | Y             |             | The value is the field name. |
| Length           | N             | 0           | Size of field to be used.    |

If **Non Uniform Rows** is on, user must enter information about Header (**HR**), Splitter (**TR**), Data (**TD**) and Footer (**LR**). It is used to support data when a file has an irregular row width.

**HR**

| **Property** | **Mandatory** | **Default** | **Description**                                           |
| ------------ | ------------- | ----------- | --------------------------------------------------------- |
| HR Start     | Y             |             | Header starts with HR value.                              |
| Number of HR | Y             | 1           | Number of header.                                         |
| Ignore       | N             | Uncheck     | To be ignored when number of line over than length value. |
| Field        | Y             |             | The value is a field name.                                |
| Length       | Yes           | 0           | Size of field to be used.                                 |

**TR**

| **Property** | **Mandatory** | **Default** | **Description**                                           |
| ------------ | ------------- | ----------- | --------------------------------------------------------- |
| TR Start     | Y             |             | Splitter starts with TR value.                            |
| Number of TR | Y             | 1           | Number of splitter.                                       |
| Ignore       | N             | Uncheck     | To be ignored when number of line over than length value. |
| Field        | Y             |             | The value is a field name.                                |
| Length       | Y             | 0           | Size of field to be used.                                 |

**TD**

| **Property** | **Mandatory** | **Default** | **Description**                                           |
| ------------ | ------------- | ----------- | --------------------------------------------------------- |
| TD Start     | Y             |             | Data starts with TD value.                                |
| Number of TD | Y             | 1           | Number of data.                                           |
| Ignore       | N             | Uncheck     | To be ignored when number of line over than length value. |
| Field        | Y             |             | The value is a field name.                                |
| Length       | Y             | 0           | Size of field to be used.                                 |

**LR**

| **Property** | **Mandatory** | **Default** | **Description**                                           |
| ------------ | ------------- | ----------- | --------------------------------------------------------- |
| LR Start     | Yes           | 1           | Footer starts with LR value.                              |
| Number of LR | Yes           |             | Number of footer.                                         |
| Ignore       | No            | Uncheck     | To be ignored when number of line over than length value. |
| Field        | Yes           |             | The value is a field name.                                |
| Length       | Yes           | 0           | Size of field to be used.                                 |

**XLS**

Use **XLS** to support file format for getting information from Microsoft Excel documents.

| **Property** | **Mandatory** | **Default** | **Description**                                      |
| ------------ | ------------- | ----------- | ---------------------------------------------------- |
| Sheet Name   | Y             |             | The document name of the xls type that want to read. |

**DELIMITED**

Use **Delimited** to support file format has a text file with delimiter character.

| **Property** | **Mandatory** | **Default** | **Description**                           |
| ------------ | ------------- | ----------- | ----------------------------------------- |
| Delimited    | Y             |             | The character used as Delimite&#x72;**.** |

**XML**

Use **XML** to support file format for getting information from **Extensible Markup Language (XML)** format.

| **Property**        | **Mandatory** | **Default** | **Description**                                                                    |
| ------------------- | ------------- | ----------- | ---------------------------------------------------------------------------------- |
| Number of Rules     | Y             | 1           | The Number of Required Field Name.                                                 |
| Required Field Name | Y             |             | The value is a file name.                                                          |
| Element Type        | Y             |             | The value is a type of element, there 2 types as following: element and attribute. |
| Path in XML File    | Y             |             | XML path to that element or attribute.                                             |
| End TagName         | Y             |             | The name of element used to stop reading of a field.                               |
| Type Field Name     | Y             | String      | Type of a field name.                                                              |

When **Remove Duplicate Records** is on, system will remove duplicate records.

| **Property**                       | **Mandatory** | **Default** | **Description**                                     |
| ---------------------------------- | ------------- | ----------- | --------------------------------------------------- |
| Number of Remove Duplicate Records | Y             | 1           | Number of Duplicate Records.                        |
| Remove Field Name                  | Y             |             | The value is the field used to determine duplicate. |

When **Apply Filter** is on, system will filter the data.

| **Property**      | **Mandatory** | **Default** | **Description**                    |
| ----------------- | ------------- | ----------- | ---------------------------------- |
| Filter Expression | Yes           |             | The value which is used to filter. |

When **Apply Sort** is on, system will sort data.

| **Property**         | **Mandatory** | **Default** | **Description**                                                     |
| -------------------- | ------------- | ----------- | ------------------------------------------------------------------- |
| Number of Apply Sort | Y             | 1           | Number of sort.                                                     |
| Sort Field Name      | Y             |             | The value is a field name for sorting.                              |
| ASC                  | N             | Uncheck.    | Type of sorting used. To get ascending order data check this field. |

When **Transform Fields** is on, system will convert data to a desired type.

| **Property**               | **Mandatory** | **Default** | **Description**                         |
| -------------------------- | ------------- | ----------- | --------------------------------------- |
| Number of Transform Fields | Y             | 1           | Number of a transform.                  |
| Field Name                 | Y             |             | The value is field name for converting. |
| Type to transform          | Y             |             | Type result for converting.             |

When **Move File after Completion** is on, system will move the file to the set directory once reading success or error.

| **Property**                          | **Mandatory** | **Default** | **Description**                                             |
| ------------------------------------- | ------------- | ----------- | ----------------------------------------------------------- |
| Success Directory                     | Y             |             | Path of directory to move when reading success.             |
| Append Datetime after Move of Success | N             | Uncheck     | The value is used to append datetime after move of success. |
| Error Directory                       | Y             |             | Path of directory to move when reading error.               |
| Append Datetime after Move of Error   | N             | Uncheck     | The value is used to append datetime after move of error.   |

In **FileRead Parameter** tab, **"Open Mapping Parameter"** button is used to set mapping parameter of a File read node task. When click **Open Mapping Parameter** button, the system will redirect user to **Mapping Parameter** screen and the user can click **Mapping Parameter Input** line or **Mapping Parameter Output** line to mapping parameter for this **File ReadTask**

**On Mapping Parameter screen:**

When **FIXWIDTH** is selected as **File Type**, system will show a parameter for **Non Uniform Rows** to be set to on or off for a file. When **XLS** is selected as **File Type**, system will show parameters to support the excel sheets. User must create an output parameter to support the columns of an excel file. When **DELIMITED** is selected as **File Type**, system will show a parameter for **Delimited** type. When **XML** is selected as **File Type**, system will display the parameters to define the XML structure.

{% hint style="info" %}
**Note**: User must click "**Save Panel**" to save all configuration changes.
{% endhint %}
