# Get File Content

This is pre-built Action located under the **@Generic Element,** instructs the Avo Assure to get the content from the .txt or .pdf formatted file and save the result in dynamic variable.

### **Syntax**

**Input value:**

**For Text:** `<file path>;<line number>(optional)`&#x20;

| Argument                             | Description                                                                         |
| ------------------------------------ | ----------------------------------------------------------------------------------- |
| <p>\<file path></p><p>(Required)</p> | Provide file path from where the content needs to be extracted.                     |
| <p>\<line number><br>(Optional)</p>  | Specify the line number from which the content needs to be extracted from the file. |

**For PDF:** `<PDF_Filepath>;<pageNumber>;<start string(optional)>;<EndString(optional)>;<image/all/text(optional)>`&#x20;

| Argument                                 | Description                                                                                                                                              |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<PDF\_Filepath></p><p>(Required)</p> | Provide the file path of the PDF from which the content needs to be extracted.                                                                           |
| <p>\<pageNumber><br>(Required)</p>       | Specify the page number from which content should be extracted from the PDF file                                                                         |
| <p>\<start string><br>(Optional)</p>     | Specify the text marker that indicates where the content extraction should begin.                                                                        |
| <p>\<EndString><br>(Optional)</p>        | Specify the text marker that indicates where the content extraction should stop.                                                                         |
| <p>\<image/all/text><br>(optional)</p>   | <p>Defines the type of content to extract:<br>• text → extracts only text<br>• image → extracts only images<br>• all → extracts both text and images</p> |

**Output value:**&#x20;

| Argument                                 | Description                                              |
| ---------------------------------------- | -------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This variable stores the extracted content from the file |
| <p>\<Dynamic Variable><br>(Optional)</p> | This variable stores the status as **true** or **false** |

**Example 1**

**Retrieve specific or full content from a file** \
\
The **Get File Content** action retrieves content from the specified file path provided in the Input Value column (e.g., **C:\sam\sample.txt;1**). If a line number is specified, only that specific line is retrieved; otherwise, the entire file content will retrieve. The retrieved content is stored in the **{File Content}** variable, and the action status is saved in the **{Status}** variable with the following possible values:

* **True** – if the content is retrieved successfully
* **False** – if the content is not retrieved

<figure><img src="/files/Wjw5UlqIbRth37ueHzTO" alt=""><figcaption></figcaption></figure>

**Example 2**

**Extract content from a PDF file**\
\
The **Get File Content** action retrieves the content from a PDF file (e.g., **C:\Docs\sample.pdf;2;Invoice Start;Invoice End;text**) based on the file path, page number, and optional start and end strings provided in the Input Value column. It allows extraction of specific content (text, image, or all) from a defined section of a specific page. The retrieved content is stored in the **{PDF Content}** variable, and the action status is saved in the **{Status}** variable with the following possible values:

* **True** – if the content is retrieved successfully
* **False** – if the content is not retrieved

<figure><img src="/files/UQpMuvdxyH3fr4em6csC" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/file-and-folder-operations/get-file-content.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
