# How to compare 2 csv files

**URL:** <https://forum.knime.com/t/how-to-compare-2-csv-files/32419>\
**Category:** KNIME Analytics Platform\
**Created:** [April 21, 2021, 2:34pm UTC](https://forum.knime.com/t/how-to-compare-2-csv-files/32419 "2021-04-21T14:34:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![TotalDataLoss](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@TotalDataLoss](https://forum.knime.com/u/TotalDataLoss)\
**Post date:** [April 23, 2021, 11:16am UTC](https://forum.knime.com/t/how-to-compare-2-csv-files/32419/4 "2021-04-23T11:16:32Z")

</div>

Hi iperez, Thanks for your answer and sorry for not coming back to you yesterday, i was experimenting a lot with your solution. It’s an interesting one I built a working solution yesterday, so thanks to you. But i ran a bit into trouble with it (but more the general question how to store a “data driven calculation” in a “flat” flow variable in Knime.  
I made a separate Post about it since it’s a broader more general question in case you are interested you can find it here:

> [@What is a good to store a Calculation like Rowcount in a flow Variable?](https://forum.knime.com/t/what-is-a-good-to-store-a-calculation-like-rowcount-in-a-flow-variable/32469):
>
> Hi all, i stumbled a across a bigger problem for myself yesterday: I don’t get it done to do a calculation like RowCount for a table and store it in FlowVariable so that i can use it for other calculations. What i tried is i take a Column Expressions Node which just calculates RowCount of a table “old” [Workflow] Then i thought this is easy so i take “Table Row to Variable” to make a Flow Variable “RowCountOld” out of it so that i then can use this number for a Rule-based Row filter. but th…

The solution i built yesterday thanks to you looks like this:

 ![Concatenate](https://forum-cdn.knime.com/uploads/default/original/3X/2/4/24f286ec702c9087c7e6650c5639f8a03e7ab4ca.png)

The problem occured on the yellow marking. But interestingly the it did work in the end anyhows 😉  
So the approach (as you can probably already see) was to take the rowcount of the old csv, and by cutting out the newly added rows (since its ordered by time of entry) in the new file. So basically reproducing the old file out of the new file then concatenate… and so on.

The endresult was right but has some drawbacks:

One Disadvantage of concatenate is logically that the lines are not directly underneath each other (or side by side), i mean logically first comes all the line from file1 than all the lines from file2.

But it was very handy to learn how you used the “Duplicate Row filter” mark “unique” rows. Something i would have not thought about. This was very slick to know for future tasks.

Thanks and have a good one!

---

_[View the full topic](https://forum.knime.com/t/how-to-compare-2-csv-files/32419)._
