Compare csv's to find similarities and disimilarities

excel
csv

#1

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.


#2

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


#3

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


#4

#5

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


#6

@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.


#7

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


#8

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


#9

@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 !


#10

@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.


#11

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


#12

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


#13

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


#14

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??


#15

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.


#16

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!


#17

This is the first csv file


#18

This is the second csv file


#19

@ddrdushy1

And finally, this is the required output.


#20

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