[Tutor] Newbie: Help on comparing files

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Thu Jan 8 13:06:33 EST 2004



On Thu, 8 Jan 2004, Isr Gish wrote:

>    >> I have 2 exports of the registry (from Widows CE). I would like to
>    >> see
>    >> the differences between the 2. What key/values both have, and what is
>    >> in one and not in the other. Etc. Hope its clearer now what I want.
>    >
>    >Ok, sounds good.  Sounds like you may want regular expressions then,
>    >and split against two "end-of-line" characters.  Here's an example
>    >of split():
>    >
>    >###
>    >>>> 'helloworldthisisatestoh'.split('o')
>    >['hell', 'w', 'rldthisisatest', 'h']
>    >###
>
> I just want to make clear what your saying. That I'm rather off using
> Regular Expressions to divide the files. Rather then slicing a string
> from one file and searching if its in the other...


Hi Isr,


You're going to have to try it out.  *grin*


Again, this is much too close to a homework assignment for my own comfort;
I don't think any of us can say much more about this without seeing what
you have done so far.


If you're still stuck, simplify the problem and try working on that
variation.  Your experience with a simpler problem should help you with
the original problem.

Here's one possible simplification: assume for the moment that there's
only one chunk of text in the first file.  With that restriction, can you
solve the problem?  How would you check to see if that single chunk exists
in the second file?


Good luck to you!




More information about the Tutor mailing list