GNU bug report logs - #20018
Question: Two txt file difference to a new txt file?

Previous Next

Package: diffutils;

Reported by: H0PE <planeth0pe <at> yahoo.com.au>

Date: Fri, 6 Mar 2015 19:13:01 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eric Blake <eblake <at> redhat.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#20018: closed (Question: Two txt file difference to a new txt
 file?)
Date: Sat, 07 Mar 2015 00:05:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 06 Mar 2015 17:04:43 -0700
with message-id <54FA409B.1090609 <at> redhat.com>
and subject line Re: [bug-diffutils] bug#20018: Question: Two txt file difference to a new txt file?
has caused the debbugs.gnu.org bug report #20018,
regarding Question: Two txt file difference to a new txt file?
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
20018: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20018
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: H0PE <planeth0pe <at> yahoo.com.au>
To: "bug-diffutils <at> gnu.org" <bug-diffutils <at> gnu.org>
Subject: Question: Two txt file difference to a new txt file?
Date: Fri, 6 Mar 2015 18:28:24 +0000 (UTC)
[Message part 3 (text/plain, inline)]
Hi guys,


 
I'm having hard timewith diffutils and I need your help. What I've done is:

-I've created a regsnapshot before installing an app (with regedit's export function from the fullregistry)

-After installing theapp I've taken another snapshot from the registry (same way as above)


 
What I would like to dois to put the new information (difference) from the second.reg file to anotherfile with diffutils.


 
So far I've figured thisout to get the cleanest way:


 
diff -n -a before.txtafter.txt >diff.txt


 
I've renamed the two regfile to txt but I doubt this would matter.


 
But my problem when Iopen diff.txt is this:

Quote from diff.txt:

"3424a3425,3429

>  [ H K E Y _ L O C A L _ M A C H I N E\ S O F T W A R E \ C l a s s e s \ * \ s h e l l e x \ C o n t e x t M e n u Ha n d l e r s \ D e s k t o p D o c k S h e l l E x t ] 

 

>  

 

>  [ H K E Y _ L O C A L _ M A C H I N E\ S O F T W A R E \ C l a s s e s \ * \ s h e l l e x \ C o n t e x t M e n u Ha n d l e r s \ F e n c e s S h e l l E x t ] 

 

>  @ = " { 1 9 8 4 D D 4 5 - 5 2 CF - 4 9 c d - A B 7 7 - 1 8 F 3 7 8 F E A 2 6 4 } " 

 

>  

 

15782a15788,15799

>  [ H K E Y _ L O C A L _ M A C H I N E\ S O F T W A R E \ C l a s s e s \ C L S I D \ { 1 9 8 4 D D 4 5 - 5 2 C F - 49 c d - A B 7 7 - 1 8 F 3 7 8 F E A 2 6 4 } ] 

 

>  @ = " F e n c e s S h l E x t  C l a s s " 

 

>  " D i s a b l e P r o c e s s Is o l a t i o n " = d w o r d : 0 0 0 0 0 0 0 1 

 

>  " L o c a l i z e d S t r i n g" = " F e n c e s " 

 

>  

 

>  [ H K E Y _ L O C A L _ M A C H I N E\ S O F T W A R E \ C l a s s e s \ C L S I D \ { 1 9 8 4 D D 4 5 - 5 2 C F - 49 c d - A B 7 7 - 1 8 F 3 7 8 F E A 2 6 4 } \ D e f a u l t I c o n ] 

 

>  @ = " C : \ \ P r o g r a m  F i l e s \ \ S t a r d o c k \ \ F e n c e s \ \ F e n c e s M e n u .d l l , 0 " 

 

>  

 

>  [ H K E Y _ L O C A L _ M A C H I N E\ S O F T W A R E \ C l a s s e s \ C L S I D \ { 1 9 8 4 D D 4 5 - 5 2 C F - 49 c d - A B 7 7 - 1 8 F 3 7 8 F E A 2 6 4 } \ I n p r o c S e r v e r 3 2] 

 

>  @ = " C : \ \ P r o g r a m  F i l e s \ \ S t a r d o c k \ \ F e n c e s \ \ F e n c e s M e n u .d l l " 

 

>  " T h r e a d i n g M o d e l" = " A p a r t m e n t " 

 

>  

 "


 
Issues I got -and Ican't figure out-:

1.)How to get rid ofthe >  characters from the beginning -so diffutil wouldn't evenwrite it to there in the first place-?

2.)I dont want toinclude diffutil difference notes to the file (e.g.: 3424a3425,3429)

3.)Why diffutil addspaces after every damn character? I can't figure out how to get rid of this-so diffutil wouldn't add a space after every character-


 
What I really need is totake the difference, put it in a new file, without changing anything, so I canuse that information later through a reg file (delete, add, whatever)?


 
Waiting for youranswers,

H0PE

[Message part 4 (text/html, inline)]
[Message part 5 (message/rfc822, inline)]
From: Eric Blake <eblake <at> redhat.com>
To: H0PE <planeth0pe <at> yahoo.com.au>, 20018-done <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#20018: Question: Two txt file difference
 to a new txt file?
Date: Fri, 06 Mar 2015 17:04:43 -0700
[Message part 6 (text/plain, inline)]
tag 20018 notabug
thanks

On 03/06/2015 11:28 AM, H0PE wrote:
> Hi guys,
> 
> 
>  
> I'm having hard timewith diffutils and I need your help. What I've done is:

[Your mail is hard to read in plain text, due to missing spaces in
various places.  Writing html mail is frowned upon in technical lists,
and doing the mail in plain text to begin with can avoid some
embarrassment when the list automatically converts your html into plain
text.]

>  
> diff -n -a before.txtafter.txt >diff.txt

This creates a binary diff in ed-script format.

> Issues I got -and Ican't figure out-:
> 
> 1.)How to get rid ofthe >  characters from the beginning -so diffutil wouldn't evenwrite it to there in the first place-?

You don't.  The output is correct for what you asked for.  Rather, it
sounds like you DON'T want to do a binary diff, but instead want to do a
content-specific diff.  That is, using diffutils is the wrong tool for
what you appear to want.

There are other tools, such as hivex (low-level) and virt-win-reg (built
on top of hivex, which formats a hive file into a registry file), that
are better equipped to read registry files _as structured data_, rather
than diffutils' approach of a raw binary byte stream.  Using tools like
this can generate usable registry scripts that represent the difference
between two hive files.  For a demonstration, read Rich Jones' blog:
https://rwmj.wordpress.com/2011/06/05/tip-using-a-backing-file-to-record-file-and-registry-changes-part-3/

> 
> 2.)I dont want toinclude diffutil difference notes to the file (e.g.: 3424a3425,3429)

Again, it sounds like you are using the wrong tool.

> 
> 3.)Why diffutil addspaces after every damn character? I can't figure out how to get rid of this-so diffutil wouldn't add a space after every character-

That's because the hive format uses UTF-16 characters (where ASCII
characters are represented by the two-byte sequence of the ASCII byte
and a NUL byte, which your viewer is rendering as a space).  When using
diffutils to compare hive files, you are seeing raw UTF-16 streams, and
NOT the typical registry files (which can be written in pure ASCII).

As you have not demonstrated any bug in diffutils, I'm closing this bug
report.  Hopefully, by pointing you at higher level tools more suited to
your task, I've helped you figure out the difference between binary
diffs (diffutils' specialty) and structured diffs (hivex' specialty).
Good luck, and feel free to ask more questions on the topic even though
the bug is closed, although the answer on this list may merely be
redirecting you over to the hivex list.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 10 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.