in reply to Re: CSV Diff Utility
in thread CSV Diff Utility
Use sed to clean up any potential issues
What are you talking about?
CSV is like HTML - it should be parsed not have a single regex applied to it. While it is possible to build a sed parsing script - it is a nightmare to maintain and does not come close to having the logic functionality of Perl.
Use sort to re-order the file based on the unique-key column
How exactly do you propose to do that? CSV is not fixed width and with imbedded quote characters being escaped it doesn't sound too easy. While I think awk might be up to the challenge, it seems that each set of CSV files would require a unique solution.
diff the newly-generated file against the last one we processed
I guess you didn't read the requirements section of my post. Being able to have the user specify columns to be ignored in the comparison, being able to select which columns are case sensitive, being able to get which individual fields are different and not just the entire record.
Finally, I indicated that this had to be "user friendly" and never mentioned speed as a bonus let alone a requirement. I am quite familiar with *nix utilities and don't hesitate to use them when they are the "right tool" for the job. They can't make my "life MUCH easier here" if they fail to meet the requirements.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CSV Diff Utility
by swngnmonk (Pilgrim) on Jun 23, 2004 at 17:23 UTC | |
by Limbic~Region (Chancellor) on Jun 23, 2004 at 18:53 UTC |