I have two .csv-files, master.csv and slave.csv, and I need to compare those two and get the difference to output in a file.
The master.csv-file contains the up-to-date entries and slave.csv contains the entries that are "active" and need to be updated. In master.csv there might have been entries added or removed and I need the diff in two files, lets say master.added.csv and master.removed.csv and in those files there are Only the entries that got added/removed and nothing more.
I hope you understand what I'm looking for. Is this possible?
by nohandle at 2013-01-10 01:09:51
Yes, you can do it, and if the data are in the same format in both files you can do it quite easily I suppose. I would try to handle the files as plain text. Loading them in memory and comparing them. see these posts: viewtopic.php?f=2&t=923 viewtopic.php?f=2&t=991
If you have any problems implementing this, let me know.
by PatricF at 2013-01-10 01:10:57
Thanks for the quick reply, I will check this out!
by PatricF at 2013-01-10 05:11:25
It worked perfectly, thank you very much!
The topic ‘Compare two csv-files and output the diff’ is closed to new replies.