сравнить и найти отличия 2 огромных текстовых файлов (50 ГБ)

1882
Reema50

Я хочу найти различия между двумя текстовыми файлами (более 50 ГБ) каждый.

Я пытался, diffно у меня memory exhaustedпроблема.

Я использую Windows7. Мой код на PHP. Я звонил diff из моего php как:

shell_exec("C:\\cygwin64\\bin\\bash.exe --login -c 'diff $text_files_path/$OldDatabaseFile.txt $text_files_path/$NewDatabaseFile.txt > $text_files_path/TempDiff_$OldDatabaseFile$NewDatabaseFile.txt 2>&1'"); 

Кто-то рассказал мне о rdiffтом, что генерирует подпись и дельта, но я не проверял это, потому что я не знаю, как начать.

Откуда я могу его установить? Откуда я могу его запустить? Из windows cmd или cygwin cmd?

1
Возможный дубликат [Какую программу использовать для сравнения больших файлов в Windows?] (Http://superuser.com/questions/34962/what-program-to-use-to-compare-big-files-under-windows) Ƭᴇcʜιᴇ007 8 лет назад 1
@ Ƭᴇcʜιᴇ007 Я не хочу программу с графическим интерфейсом! Я хочу написать команду, которая вызывает такую ​​утилиту в моем PHP-коде. Reema50 8 лет назад 0
Там есть много ответов, и многие из них не являются программами с графическим интерфейсом. Ƭᴇcʜιᴇ007 8 лет назад 0
Извините, но я пробую "не программы с графическим интерфейсом": fc и comp, а не то, что я ищу. Благодарю. Reema50 8 лет назад 0

2 ответа на вопрос

0
Jakuje

Did you try --speed-large-files switch to diff? It should waste less memory:

diff --speed-large-files [...] 

From manual page for diff:

--speed-large-files

assume large files and many scattered small changes

Да. Я попробую. Та же самая проблема! Reema50 8 лет назад 0
0
DavidPostill

From where can I install it (rdiff)?

Someone told me about rdiff that generates signature and delta but, I did not test it because I do not know how to begin. From where can I install it? and from where can I run it? From windows cmd or cygwin cmd?

Cygwin includes rdiff. It is in the rdiff-1.0.0-1 package.


From where can I run it (rdiff)?

Someone told me about rdiff that generates signature and delta but, I did not test it because I do not know how to begin. From where can I install it? and from where can I run it? From windows cmd or cygwin cmd?

You run rdiff a Cygwin bash shell.

shell_exec("C:\\cygwin64\\bin\\bash.exe --login -c 'diff $text_files_path/$OldDatabaseFile.txt $text_files_path/$NewDatabaseFile.txt > $text_files_path/TempDiff_$OldDatabaseFile$NewDatabaseFile.txt 2>&1'"); 

A command similar to the above (replacing diff with rdiff and modifying the command options as necessary) should work.


How can I find out which package rdiff is in?

The easiest way to find the package containing a particular command is to use Cygwin Package Search web page:

enter image description here

Scroll to the bottom of the page:

enter image description here

Click on rdiff-1.0.0-1:

enter image description here

This confirms that rdiff-1.0.0-1 is the correct package to install.

See Installing and Updating Cygwin Packages for installation instructions.