emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#20018: closed (Question: Two txt file difference t


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#20018: closed (Question: Two txt file difference to a new txt file?)
Date: Sat, 07 Mar 2015 00:05:03 +0000

Your message dated Fri, 06 Mar 2015 17:04:43 -0700
with message-id <address@hidden>
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
address@hidden)


-- 
20018: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20018
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Question: Two txt file difference to a new txt file? Date: Fri, 6 Mar 2015 18:28:24 +0000 (UTC)
Hi guys,
 
I'm having hard time with diffutils and I need your help. What I've done is:
-I've created a reg snapshot before installing an app (with regedit's export function from the full registry)
-After installing the app I've taken another snapshot from the registry (same way as above)
 
What I would like to do is to put the new information (difference) from the second.reg file to another file with diffutils.
 
So far I've figured this out to get the cleanest way:
 
diff -n -a before.txt after.txt >diff.txt
 
I've renamed the two reg file to txt but I doubt this would matter.
 
But my problem when I open 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 H a 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 H a 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 C F - 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 - 4 9 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 I s 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 - 4 9 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 - 4 9 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 I can't figure out-:
1.)How to get rid of the >  characters from the beginning -so diffutil wouldn't even write it to there in the first place-?
2.)I dont want to include diffutil difference notes to the file (e.g.: 3424a3425,3429)
3.)Why diffutil add spaces 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 to take the difference, put it in a new file, without changing anything, so I can use that information later through a reg file (delete, add, whatever)?
 
Waiting for your answers,
H0PE

--- End Message ---
--- Begin Message --- 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 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
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

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]