Bandhingake rong TXT nggunakake Ruby

Pemeriksa beda Ruby sing akurat banget kanggo mbandhingake TXT file lan nemokake bedane

Ruby SDK kita sing kuat ngidini sampeyan nemokake prabédan antarane TXT dokumen lan nyimpen asil menyang format sing trep kanggo dideleng. Kanggo verifikasi kemampuan produk, mbandhingake TXT file nggunakake perpustakaan Ruby iki lan deleng bedane.

Ndeleng potongan kode

Bandhingake TXT ing Ruby

Kita Ruby SDK dirancang kanggo menehi asil sing paling akurat, sanajan perbandingan minangka fungsi sing kompleks.

Kadhangkala sampeyan kudu mesthekake yen dokumen ing TXT format durung diganti, lan yen wis, sampeyan kudu ngerteni apa bedane. Cukup gunakake alat diff Ruby kanggo mbandhingake rong TXT file lan temokake bedane kabeh tembung utawa karakter tunggal. Kajaba iku, yen mung siji karakter ing tembung sing diganti, tembung iki bakal ditandhani minangka diganti kabeh.

Saiki sampeyan ora perlu maneh nglampahi wektu kanthi manual mbandhingake TXT dokumen, lan sampeyan bisa kanthi cepet nemokake owah-owahan cilik lan ngekspor bedane kasebut menyang dokumen kanthi format sing trep.

Coba mbandhingake TXT dokumen

Priksa kepiye solusi kanggo mbandhingake TXT file nggunakake Ruby SDK. Kanggo entuk iki, muat TXT file sing pengin dibandhingake lan pilih format file ekspor - bakal dimuat kanthi otomatis sawise mbandhingake.

Elinga yen sampeyan kudu nampa kabeh revisi ing dokumen sing dibandhingake sadurunge nelpon metode perbandingan, kaya sing ditampilake ing conto kita:

Unggah file sing dibandhingake
Kode roto
Unggah file kapindho kanggo mbandhingake
Pilih format target saka dhaptar
require 'aspose_words_cloud'

AsposeWordsCloud.configure do |config|
  config.client_data['ClientId'] = '####-####-####-####-####'
  config.client_data['ClientSecret'] = '##################'
end
@words_api = WordsAPI.new
file_name1= 'Input1.txt'
file_name2= 'Input2.txt'
file_result= 'Output.txt'

#  Unggah dokumen menyang panyimpenan maya.
first_document_content = File.open(file_name1)
upload_first_file_request =
    UploadFileRequest.new(file_content: first_document_content, path: file_name1)
@words_api.upload_file(upload_first_file_request)

second_document_content = File.open(file_name2)
upload_second_file_request =
    UploadFileRequest.new(file_content: second_document_content, path: file_name2)
@words_api.upload_file(upload_second_file_request)

#  Bandhingake dokumen ing awan.
compare_data_options =
    CompareData.new({:Author => 'author',
        :FileReference => AsposeWordsCloud::FileReference.fromRemoteFilePath(file_name2)})
compare_document_request =
    CompareDocumentRequest.new(
	name: file_name1, compare_data: compare_data_options, dest_file_name: file_result)
@words_api.compare_document(compare_document_request)

#  Download dokumen asil saka panyimpenan awan.
download_file_request = DownloadFileRequest.new(path: file_result)
download_file_result = @words_api.download_file(download_file_request)
File.open('compareResult.pdf', 'wb').write(download_file_result)
Kode roto
  
Nyalin kode Ruby menyang clipboard

Cara mbandhingake rong file teks

  1. Pasang Aspose.Words Cloud for Ruby
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Ruby sampeyan
  3. Muat rong TXT dokumen kanggo mbandhingake
  4. Telpon metode compare_document() kanggo mbandhingake TXT docs
  5. Download dokumen asil saka panyimpenan maya

Ruby perpustakaan kanggo nggunakake mbandhingake

Instal Aspose.Words Cloud SDK for Ruby nggunakake layanan hosting RubyGems. gem install aspose_words_cloud kanggo nginstal paket kasebut. Minangka alternatif, sampeyan bisa kanthi manual kloning Aspose.Words Cloud SDK for Ruby saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Ruby 2.6 utawa luwih anyar

Deleng Repository Documentation kanggo ndeleng rincian.

Format file liyane sing didhukung

Sampeyan bisa nindakake operasi mbandhingake kanggo format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.