Compare csv's to find similarities and disimilarities

hey,

I am literally stuck with this!. Need urgent help on this guys. the scenario is like I a m having two csv s with one column as integer and another column as string. I need to compare these two csv s to find the similarities and disimilarities.I used for loop to loop the 2 csvs and after that I ma stuck with “enter vb expression” in the IF loop I used.Expecting your contributions soon. Thanx in advance.

1 Like

I am having same issue. I googled a bit and found cint used in “If condition” … But still having errors.

Me too tried that. cint(row(0))=cint(item(0)). but no luck !

1 Like

do you want to compare all the column values? or have to check specific column?

1 Like

@ddrdushy1 hey thanx for responding. I need to compare all the columns in the CSV file.

I a m having two csv s with one column as integer and another column as string.

i am attaching my sample csv file along with this.

@badita im having a csv file not an excel. I guess both need different steps to compare.

It’s the same case. You’re reading them and compare in memory the two resulting datatables.

1 Like

@badita ok then. can you please help me with the VB expression part in the IF loop I gave.

tried with. cint(row(0))=cint(item(0)). but no luck !

@badita @amithvs @ddrdushy1

Guys. I got the output data table for similarities in csv. But I am not getting the output for dissimilarities.
I used CInt(row(0))=CInt(item(0)) in If statement.
Can you please help.

1 Like

@UnicornStark i tried this. It is working perfectly. I am also not getting the dissimilarities part.

create one more data table and put add data column in else part then u will get the dissimilarities.

1 Like

tried the same earlier itself. But resulting in and csv with repeating output in a kind of a pattern.Not getting exact one. @ddrdushy1

Tried that too. But still showing error. I used “rows.itemarray” as input in “Add Data Row” activity. So, how will we use Add Data Column instead??

hi, can you please give correct input and out put for your workflow. its bit confusing to understand your requirement. use sample values and give your two input tables and what kind of output you need.

Thanks bro…
I have two input csv files.
It should be compared and the “similarities” should be one ouput csv file and the “Differences” should be another.
Each csv consists of 2 columns and 3 rows

INPUT
csv1 csv2
1 a 1 a
2 b 2 b
3 c 4 d

OUTPUT : Similar Dissimilar
1 a 3 c
2 b 4 d

I got the workflow for getting “Similar” output. But need help for the second one “Dissimilar”
Thanks in advance!

This is the first csv file

This is the second csv file

@ddrdushy1

And finally, this is the required output.

try this and let me know, comparetwocsv.zip (4.1 KB)

2 Likes