# Cell by Cell Compare

This is pre-built Action located under the **@Generic Element,** instructs the Avo Assure to compare file by checking cell by cell and save the result in the given dynamic variable.

{% hint style="warning" %}
**Note:** It can compare pair of Excel files OR CSV files OR an Excel and a CSV file.
{% endhint %}

### **Syntax**

**Input Value:** `<CSV/Excel file path1>;<Sheet name(optional)>;<CSV/Excel file  path2>;<Sheet name(optional)>`&#x20;

| Argument                                        | Description                                                                                                                               |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<csv/Excel file path1></p><p>(Required)</p> | Provide the path to the first file (source or reference), which can be in .csv, .xls, or .xlsx format.                                    |
| <p>\<Sheet name><br>(Optional)</p>              | <p>Specify the sheet name in the first Excel file (if applicable).<br><em><strong>Note:</strong> This is ignored for CSV files.</em></p>  |
| <p>\<csv/Excel file path2><br>(Optional)</p>    | Provide the path to the second file (target/actual file to compare), which can be in .csv, .xls, or .xlsx format.                         |
| <p>\<Sheet name><br>(Optional)</p>              | <p>Specify the sheet name in the second Excel file (if applicable).<br><em><strong>Note:</strong> This is ignored for CSV files.</em></p> |

**Output Value:**&#x20;

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

**Example 1**

**Compare an Excel file and a CSV file**

The **Cell by Cell Compare** action performs a comparison between an Excel file and a CSV file (e.g., **C:\Files\Report.xlsx;Sheet1;C:\Files\Report.csv**). This allows validation of content between formats for consistency. The result of the comparison is stored in the **{Comparison Result}** variable, with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F769LLnsnQJIDYrZ3DOBY%2Fimage.png?alt=media&#x26;token=5029733d-2fd3-477c-952e-071900d884d6" alt=""><figcaption></figcaption></figure>

**Example 2**

#### Compare two Excel files with sheet names

The **Cell by Cell Compare** action performs a comparison between two Excel files with specified sheet names (e.g., **C:\Files\OldData.xlsx;SheetA;C:\Files\NewData.xlsx;SheetB**). This helps verify whether data across sheets has changed or remained consistent. The result of the comparison is stored in the {Comparison Result} variable, with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FgCooLqAPGEy4YmMrSGOa%2Fimage.png?alt=media&#x26;token=6eb1a09a-1659-4caf-84e8-ae2446c436f8" alt=""><figcaption></figcaption></figure>

**Example 3**

#### Compare two CSV files

The **Cell by Cell Compare** action performs a comparison between two CSV files (e.g., **C:\Files\Jan\_Sales.csv;C:\Files\Feb\_Sales.csv**). The result of the comparison is stored in the {Comparison Result} variable,  with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FwZRl3Y2h3vzmJDibEkr9%2Fimage.png?alt=media&#x26;token=fdc75a85-0366-47f9-b74a-53f633b2c4e8" alt=""><figcaption></figcaption></figure>
