# Clear File Content

This is pre-built Action located under the **@Generic Element,** instructs the Avo Assure to clear the content of the file whose path is provided in Input value and save the result in the dynamic variable.

### **Syntax**

**Input Value:**

**For Text File:** `<file location>;<file name>`&#x20;

| Argument                                 | Description                                                                                                       |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| <p>\<file location></p><p>(Required)</p> | <p>Provide the path of the file whose content is to be cleared.<br>Supported format:<br><strong>.txt</strong></p> |
| <p>\<file name><br>(Required)</p>        | Provide file name within which the content should be cleared.                                                     |

**For Excel File:** `<file location>,<file name>;<sheet name>(Optional)`&#x20;

| Argument                                 | Description                                                                                                                                    |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<file location></p><p>(Required)</p> | <p>Provide the path of the file whose content is to be cleared.<br>Supported format:<br><strong>.xls</strong>, and <strong>.xlsx</strong>,</p> |
| <p>\<file name><br>(Required)</p>        | Provide file name within which the content should be cleared.                                                                                  |
| <p>\<sheet name><br>(Optional)</p>       | Provide sheet name within which the content should be cleared.                                                                                 |

**Output value:**&#x20;

| Argument                                                    | Description                                              |
| ----------------------------------------------------------- | -------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | This variable stores the status as **true** or **false** |

**Example 1**

**Clear the content of a specified text file**\
\
The **Clear File Content** action takes the value from the Input Value column (e.g.,**C:\sam;‪sample.txt** ) and clears the content of the file named (**sample.txt)** located at (**C:\sam**) The action status is saved in the **{Status}** variable with the following possible values:

* **True** –  if the file content is cleared successfully
* **False** – if the file content is not cleared

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FBz4MmOR1PVSmQNPB5i31%2Fimage.png?alt=media&#x26;token=9cdcb2d1-6cd7-44a0-a4a1-330da2ddcab0" alt=""><figcaption></figcaption></figure>

**Example 2**

**Clear the content of a specific Excel sheet**\
\
The **Clear File Content** action clears the content of a specified file or a sheet within a file based on the input value (e.g.,**C:\sam;Order details;sheet1**). The action status is saved in the **{Status}** variable with the following possible values:

* **True** –  if the file or sheet content is cleared successfully
* **False** –if the file or sheet content is not cleared

{% hint style="warning" %}
**Note:** If a sheet name is provided, only that sheet's content is cleared. If no sheet name is given, the entire file content is cleared
{% endhint %}

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FEWlcmrOmJR01DtXMWq1w%2Fimage.png?alt=media&#x26;token=28a38e17-d8c9-4677-8935-af1f7377c6b3" alt=""><figcaption></figcaption></figure>
