# ReadFileFirstLine (String filePath)

| **Name**    | ***ReadFileFirstLine***                                                  |
| ----------- | ------------------------------------------------------------------------ |
| Syntax      | ReadFileFirstLine (String filePath)                                      |
| Purpose     | To read and return contents of the file up until the first line.         |
| Description | Reads the first line of text of the specified file and returns the text. |
| Return Type | String                                                                   |
| Parameter   | filePath \[System.String] – Full path of the file                        |

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/0%20\(155\).png)

**Example**

In this example, we are passing the required parameter to the function transformation object using a *Variables* object.

Where,

*filePath* = C:\Users\Kanwal.Azim\OneDrive - Astera Software\Desktop\Functions Documentation\Files\ReadFileFirstLine\Test.txt

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/1%20\(156\).png)

Right-click on the function transformation object and select *Preview Output.* You can see that Astera Data Stack has returned the first line of the specified file.

![](https://github.com/astera-software/Astera_Data_Stack_v9/blob/main/.gitbook/assets/2%20\(156\).png)
