Answered

compare 2 CSV files

We want to compare two csv files using Subject 7, what are the best ways to compare 2 CSV files? Can you explain how does it work?

0
5 comments
Avatar
Rex Feizi

Would you please elaborate on the scenario. Where the CSV files located? Is there one that is dynamic and one that is static with reference values?

0
Comment actions Permalink
Avatar
Kumar Sureddi
Yes, one file has reference values and is static and the other will be on a shared drive.
0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Kumar,

Set_list command can be used to generate the lists, this command works with CSV files that can be uploaded to the platform and can also use external links for files stored on a shared drive like Dropbox for example.

https://subject7.atlassian.net/wiki/spaces/SD/pages/879493553/SET+LIST+Command

Could you please let us know what kind of comparison you are going to do? This will assist us in providing a more accurate answer depending on your scenario.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Kumar Sureddi

Hi Joseph,

we want to compare the values of each cell in a reference CSV file to another csv file. Values will be either numbers, strings or dates". Files available in S3 buckets.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Kumar,

You can use nested loop for this kind of scenario which will cycle through a value from list 1 and compare it to values in list 2 until it finds a match and breaks out of the loop. Steps 7 and 10 will print a result based on the condition (match or no match) while step 5 will constantly change to show which value is being compared to which value.

This test case was imported into your account (test case name: subject7_admin_sample). Please let us know if you have any more questions.

Regards
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.