Perl-Sensitive Sunglasses | |
PerlMonks |
Re^4: Equality checking for strings AND numbersby Anonymous Monk |
on Jul 13, 2007 at 14:26 UTC ( [id://626446]=note: print w/replies, xml ) | Need Help?? |
Here is some sample input.
The main points to note are: 1. The columns are not necessarily in the same order (the main reason I started this in the first place). 2. Data is a mixture of strings and numbers of differing precisions (but all base10). To take account of the differences in column order, I rebuild the data using a hash keyed by the XY coordinate (first 2 columns) and using the actual column name e.g
Output would be something like: X=2 Y=9 Category2 X=2 Y=9 Value2 X=2 Y=9 Result i.e. a list of the column names for which the data did not match between the two files, allowing for strings an numerical values, and accuracy to a certain precision (using the $eps approach detailed elsewhere in this thread)
In Section
Seekers of Perl Wisdom
|
|