09-28-2012
12,
0
Join Date: Sep 2012
Last Activity: 30 September 2012, 2:53 AM EDT
Posts: 12
Thanks Given: 0
Thanked 0 Times in 0 Posts
Need logic to implement file compare.
Hi all
I have a requirement where i have to develop a file compare tool.
Requirement:
I have one expected file and one actual file. Both the files are database dumps in a csv file comma seperated. The first line of the file has the column names.
Now there are 3 scenarios:
1) Firstly we have don't have records in sorted order in the file so we have to first find the corresponding match of the records.
2) Secondly if the record does not finds it match, then the record is candidate for two things: a) either it has corresponding record with mismatch, or b) it is completely new record (which has got introduced the second time when i was taking the database dumps in actual file).
constraints or issues:
1)I don't have anything like key or column value which i can use to distinguish or relate two records.
2) I cannot sort the records at database level coz i am not sure of on which column should i sort the records(also i have more than 3000 tables... so identifying such columns at database level is not feasible.)
3) I cannot use Primary keys as all of those are system generated and could generate random values.
I have tried using market tools like diff, winmerge, csvdiff, beyondCompare,CompareIt etc. but known of this tool could suffice to my requirement.
I had this tool TableTextComparator tool. This tool is perfect for my requirement, but this is not supported for linux and it also does not support command line arguments like passing file values.
I had written the logic via shell scripting. But i am still not able to satisfy my requirement on existing issues.
If anyone could recommend me some linux/unix based tool(which suffice my requirement) or tell me the logic it would be of great help.
TIA
Regards
Ganesh