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)

Argument
Description

<file path>

(Required)

Provide file path from where the content needs to be extracted.

<line number> (Optional)

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)>

Argument
Description

<PDF_Filepath>

(Required)

Provide the file path of the PDF from which the content needs to be extracted.

<pageNumber> (Required)

Specify the page number from which content should be extracted from the PDF file

<start string> (Optional)

Specify the text marker that indicates where the content extraction should begin.

<EndString> (Optional)

Specify the text marker that indicates where the content extraction should stop.

<image/all/text> (optional)

Defines the type of content to extract: • text → extracts only text • image → extracts only images • all → extracts both text and images

For Image: When the user writes ‘image’ in Input syntax it retrieves all images content present on the page within .pdf file.

For All: When the user writes ‘all’ in Input syntax then it retrieves all content including image and text data from desired page within .pdf file.

Output value:

Argument
Description

<Dynamic Variable> (Required)

This variable stores the extracted content from the file

<Dynamic Variable> (Optional)

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

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

Last updated

Was this helpful?