Automation SoftwareAutomation Anywhere
  Home > Product > Solutions > Excel Automation > T96  

T96 - Automate data comparison between applications like Excel

Task Description

Compare range of data in two excel files and log the results of comparison in a text file.

Test File T96.atmn   Test File Excel1.xls    Test File Excel2.xls

This sample task compares the range of data in Excel1.xls and Excel2.xls and saves the similar records or data in a text file.
Solutions
1 Create new task
  • Click on New -> Task Editor.
  • Click on ‘Variable Manager’ tab located on right side panel of Task Editor.
  • Create three variables of type Value. XlCol1, XlCol2 and XlCol3.
Variable Manager
Screenshot 1

Open Spreadsheet
Screenshot 2

Variable Operation
Screenshot 3

Insert Loop
Screenshot 4

Variable Manager
Screenshot 5

Log the Data
Screenshot 6

Task Editor
Screenshot 7
2 Open Excel files
  • Double click on ‘Excel’ command and select ‘Open Spreadsheet’ option to open the first excel file with session name Excel1.
  • Similarly, open second Excel file with session name, Excel2.
3 Capture the range of data to compare
  • Get the range of data to compare from first excel file i.e. from Excel1 session using Get Multiple Cells, Excel command. The range are stored in the system variable $Excel Column$.
  • Using ‘Variable Operation’ command get the data in $Excel Column(1)$, $Excel Column(2)$ and $Excel Column(3)$ into user variable, $XlCol1$, $XlCol2$ and $XlCol3$ respectively for later comparison.
4 Loop through the range of data
  • Insert ‘Loop’ command option, ‘For each row in Excel Dataset’ to loop through the data of session, Excel1.
  • Inside this loop block, capture range of data to compare with from second excel file i.e.Excel2 session using Get Multiple Cells, Excel command.
5 Compare the range of data
  • Insert another ‘Loop for each row in Excel Dataset’ command to Loop through all the data of Excel2 session.
  • Inside second loop block, use ‘If Variable’ commands to compare the data of both the sessions. Compare $Excel Column(1)$ with $XlCol1$, $Excel Column(2)$ with $XlCol2$ and $Excel Column(3)$ with $XlCol3$.
6 Log the data
  • If the result of above comparison is positive i.e. if all the three columns in both files are same, then inside If-End if block, log the data to a text file (ListofSimilarRecords.txt) using ‘Log to File’ command.
7 How to run the task
  • In case you do not have Automation Anywhere installed, please download and install it from, http://www.automationanywhere.com/download/freeTrial.htm
  • Save T96.atmn under location, My Documents\Automation Anywhere\Automation Anywhere\My Tasks
  • Save both .xls files under C:\.
  • Launch Automation Anywhere and from Task List select T96.atmn and click on RUN button to run the task.
 

Buy Now Free Trial

Next Steps
Compare versions Compare versions
Watch a flash demo Watch a flash demo
Contact me Contact me
Ask the Expert Ask the Expert
Request live demo Request live demo

Call 1-888-484-3535

Our Customers
Automation Anywhere Customers
Customer list | Case Studies

We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys.
- Jack Greenberg

Read Customer Testimonies >>
  Products     Download     Purchase     Services     Support     Customers     Company     Sitemap     Trademark FacebookTwitterAutomation Anywhere Blog © Automation Anywhere, Inc. 2012 Privacy Policy
Automation Anywhere Call: 1-888-484-3535 x1   

Automation Software - Free Trial Automation Software - View Demo