Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Large file compare

Status
Not open for further replies.

Geek8

Programmer
Apr 23, 2003
31
US
How do I write a script that does a "diff" on a 2.5 gig file and then process the record if there are no changes? I am kinda jumping into scripting and can't seem to get this to work since everytime it goes into the "diff" command, it says "memory exhausted". Is there another way?

TIA

Geek
 
from 'man diff':

-h Does a fast, half-hearted job. It works only when
changed stretches are short and well separated,
but does work on files of unlimited length.


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks Vlad. I actually did try that too earlier, but got the same &quot;memory exhausted&quot; error. I was wondering if there is anything else someone can think of to check the files.

Geek
 
one thing you can do is to 'split' the files into equal chunks and compare the corresponding chunks......

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks Guys. I guess I am going to try both methods, and see where it gets me. Vlad, what do you think the easiest method is to get the file split up?

Geek
 
'man split'

-linecount | -l linecount
Number of lines in each piece. Defaults to 1000
lines.

or 'man csplit' for 'block' splittin'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top