What exactly do you want to compare?

Do you want to verify that the product numbers and amounts are identical
betwen the 2 files? So if one file had the following (scenario 1), it
would be considered identical to the other file (i.e. logically equal)?

        122 - 2
        236 - 3
        335 - 44
        124 - 02

Or, scenario 2,  would you want the above to be considered different
(i.e. physically/binary equal)?

In case of scenario 1, you would just need to read in each file and parse
the data into hashes with the product id as the key and the quantity as
the value. Then just loop over a hash and verify that the same key in the
other hash has the same value.

In case of scenario 2, I'd look at using a diff utility or calculating a
checksum to validate that the files are identical.

On Wed, 21 Feb 2001, steve silvers wrote:

> I have two flat file:
> flat1.txt and flat2.txt
> both should have the exact same text.
>
> 122 - 2
> 334 - 44
> 236 - 3
> 124 - 2
>
> the first number is the product and the second number is the count. So
> product 122 has 2 items. I need to read in both flat files, compare both
> exactly, and print out the ones that don't match.
>
> Anyone have a good idea how to go about this?
> Thanks in advance.
> Steve
>
>
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to