1827295 Members
2543 Online
109717 Solutions
New Discussion

big diff

 
Nobody's Hero
Valued Contributor

big diff

I have 2 windows registry files that are 5-6 meg each. I want to find the difference between the 2 files and put them to one file. Just show the difference, not the < and the >.
UNIX IS GOOD
11 REPLIES 11
Nobody's Hero
Valued Contributor

Re: big diff

my output looks like this. Do I need to convert the input registry files from DOS to Unix before I run a diff?




53196,53202d51580

<
<
<
<
<
<
<
53264c51642
<
---
>
53360d51737
<
53361a51739
UNIX IS GOOD
RAC_1
Honored Contributor

Re: big diff

What command syntax you used?? I tried it and it is working fine.
I used bdiff file1 file2

Anil
There is no substitute to HARDWORK
Jairo Campana
Trusted Contributor

Re: big diff

convert file windows to unix use command

/usr/bin/dos2ux

dos2ux(1) dos2ux(1)

NAME
dos2ux, ux2dos - convert ASCII file format
legionx
Nobody's Hero
Valued Contributor

Re: big diff

I had to convert it from dos to unix.
then I ran a diff. however my diff output file is kind of complex. Is there any way I can get one report that shows what I need to add to file a to make it equal to file b.
UNIX IS GOOD
RAC_1
Honored Contributor

Re: big diff

How does you window$ registry files look like?? May be you can run strings command on them. And also dos2ux.

Anil
There is no substitute to HARDWORK
Nobody's Hero
Valued Contributor

Re: big diff

in other words, just show me what is not in file "a". Without showing me everything that is not in "a" and everything that is not in "b". Or am I confused?

my output is huge.
looks like:

> @="C:\\Program Files\\Common Files\\System\\ado\\msado15.dll"
> "ThreadingModel"="Both"
> "Class"="ADODB.ParameterClass"
> "Assembly"="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
> "RuntimeVersion"="v1.0.3705"
322a331,335
> [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{0000050B-0000-0010-8000-00AA006D2EA4}\InprocServer32\7.0.3300.0]
> "Class"="ADODB.ParameterClass"
> "Assembly"="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
> "RuntimeVersion"="v1.0.3705"
>
324c337
< @="ADODB.Parameter.2.80"
---
> @="ADODB.Parameter.2.5"
333c346
< @="C:\\Program Files\\Common Files\\System\\ADO\\msado15.dll"
---
> @="C:\\Program Files\\Common Files\\System\\ado\\msado15.dll"
334a348,350
> "Class"="ADODB.ConnectionClass"
> "Assembly"="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
> "RuntimeVersion"="v1.0.3705"
335a352,356
> [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000514-0000-0010-8000-00AA006D2EA4}\InprocServer32\7.0.3300.0]
diff_file1 (1%)


But it will take forever to make file "a" look like file "b".
UNIX IS GOOD
harry d brown jr
Honored Contributor

Re: big diff


You should be able to use diff, as diff only uses about 6 times the file size.

Additionally use the -w (ignore whitespace) option:

diff -w file1 file2

If the cr/lf's are causing problems, then use the dos2ux utility someone pointed out.

live free or die
harry d brown jr
Live Free or Die
harry d brown jr
Honored Contributor

Re: big diff

Also, add the -i (Ignore case) as I see you have an entry that has ADO and ado in a directory path, yet they are the same file path.

diff -w -i file1 file2

live free or die
harry d brown jr
Live Free or Die
Joe Harrison_1
Advisor

Re: big diff

Did you export the registry using regedit? If not, the files are binary. I suggest exporting near the level you are trying to diff:

c:\> regedit /E HKEY_LOCAL_MACHINE/Software/Microsoft/Windows hklm.txt

otherwise the files will be huge. Clean the files with:

$ sed "s///g" > hkml2.txt
Nobody's Hero
Valued Contributor

Re: big diff

Here is my problem.

the registry key looks like:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{1E083962-829F-11D3-AB5D-00C04F9407B9}]
@="MSOLAPClient Class"

when I run my diff on badbox and good box like 'diff -i -w badbox goodbox > diff_file'

and I do a grep -i olap on diff_file, I dont see anything. for some reason, the diff is not seeing any difference in the files regarding 'olap, even though I know they are different. what is stopping 'diff' from seeing the difference?
UNIX IS GOOD
Nobody's Hero
Valued Contributor

Re: big diff

is it because the '@olap' entry is on a different line, because it wrapped?
UNIX IS GOOD