Questions tagged [file-comparison]

File comparison is the act of comparing one file's properties with another's.

Use this tag for questions related to comparing the size, content, etc. of two or more files.

161 questions
0
votes
1 answer

Compare two RTF files using Python

I have two folders with RTF files, the filenames are same in both folders RTF files consists of Header and Footer in every page I have to ignore the Header and Footer part in every page and compare the content of body part I did something like this…
JoJo
  • 67
  • 8
0
votes
0 answers

Matching file contents with patterns/regex (repost after edit)

As part of a repeatable testing approach I'm looking to run a process and then compare its log file with an expected result. Here is a simplified example of the log file produced: 2020-09-01_01:00:00.000 INFO : Incoming record count…
Jim Hudd
  • 47
  • 10
0
votes
0 answers

How to compare the colums (2nd and 3rd) of 2 .csv files based on a condition in matlab or octave

I have a program based on some functionality and the results are displayed on 2 .csv files (file1 and file2) The files consist of same rows and columns, the columns are named as condition, supply1, supply2 I want to read both the files into the…
0
votes
2 answers

How to compare two files that the user has selected?

I need help trying to compare files that a user has selected. I cant seem to figure out exactly how to do it. I have the following code so far. The language is C#, and its a GUI application. At first I tried to assign a bool type variable and…
0
votes
1 answer

File comparison in python and output the difference

I am new at python and need help in comparing two TXT files and outputting their difference. Here is the scenario: These text files contains the structure of a database table. We usually update the database and make structural changes to it, so…
P_Ar
  • 377
  • 2
  • 9
  • 25
0
votes
1 answer

nodejs how to test big output text

I have project compile js to js. I wrote filename.js and compile to filename.out.js, and check manually filename.out.js, next time when I modify my compiler, I hope the output does not changed, if it changed show the diff. function…
guilin 桂林
  • 17,050
  • 29
  • 92
  • 146
0
votes
1 answer

Perl extract columns from two files based on condition

I have 2 files, say file1 and file2. file1.txt RAC1 GK1 111 RAC2 GK2 222 RAC1 GK3 333 RAC1 GK4 222 RAC2 GK5 111 file2.txt R1,PAAE,222,TESTA,COLA,NO R2,RWWG,111,TESTB,COLM,YES R3,TDAS,444,TESTC,COLZ,NO I am comparing 2 files and trying to extract…
vkk05
  • 3,137
  • 11
  • 25
0
votes
2 answers

Sorting list of files in android throwing 'Comparison method violates its general contract!'

It's happening on my Android application & here is the stack trace: Caused by java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeHi(TimSort.java:864) at…
Adi
  • 361
  • 1
  • 5
  • 23
0
votes
1 answer

After File compression I lost the Filename extension

I am trying to compress my file using the ZipOutPutStream. I tried below code and got the compressed folder with the file. But when I am extracting the folder using 7Zip, the fileName extension is missing. Also I am unable to extract the folder by…
0
votes
1 answer

How to compare two binary files and return a boolean in Python?

I am reading two files f1 and f2 into my Python code and I need to compare them and get the result as a boolean. def open_file(file_path): with open(input_file, "rb") as f: file = f.read() return file I can however compare them using…
0
votes
2 answers

Is there a way to compare every line in one text file to one line in another text file in C?

For example, I have an index text file that has 400+ English words, and then I have another text file with decrypted text on each line. I want to check each English word in my index file with each line of my decrypted text file (so checking 400+…
G_3
  • 1
  • 3
0
votes
2 answers

awk to compare multiple columns in 2 files

I would like to compare multiple columns from 2 files and NOT print lines matching my criteria. An example of this would be: file1 apple green 4 orange red 5 apple yellow 6 apple yellow 8 grape green 5 file2 apple yellow 7 grape green…
Agathe
  • 303
  • 2
  • 15
0
votes
0 answers

Visual Basic Compare Files Task

I currently have this code that will compare between two files only if each file has one column: Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile1 = objFSO.OpenTextFile("C:\Users\Downloads\Define…
0
votes
1 answer

Adding the data present in only file1 while comparing

Consider I have two excel file, compare and merging two file and genarating new report, While doing in programatically - Few data present in file 1 and that data not present in file2 so How to add the data present in only file1? If…
Easi Test
  • 133
  • 1
  • 1
  • 10
0
votes
1 answer

Formatted text file comparison in python

I have two .txt files. How would I compare them, find and print the difference(s) in a new file? My files are like: set FDN : "NetworkElement=RNC23,CmNodeHeartbeatSupervision=1" active : true set FDN :…