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
2
votes
2 answers

.Except() in compare methode do not view all files?

I develop a little software which permits me to compare 2 folders and Add files. I take principally code from msdn. That looks to work fine with some files but I have some troubles with 2 folders (292 and 268 files). In my case with the 2 big folder…
Bloops
  • 53
  • 3
2
votes
1 answer

Match two files against each other and write output as file - Python

I'm new to Python. My second time coding in it. The main point of this script is to take a text file that contains thousands of lines of file names (sNotUsed file) and match it against about 50 XML files. The XML files may contain up to thousands of…
Mo2
  • 1,090
  • 4
  • 13
  • 26
2
votes
4 answers

Bash: tell if a file is included in another

I'm trying to compare the content of two files and tell if the content of one is totally included in another (meaning if one file has three lines, A, B and C, can I find those three lines, in that order, in the second file). I've looked at diff and…
gregseth
  • 12,952
  • 15
  • 63
  • 96
2
votes
3 answers

Stuck in writing my diff utility in C++

I was trying to use what i have learned about file and resource handling in C++: I would like to write a diff-like utility. Here It is my latest version #include #include #include int main(int argc, char* argv[]) { …
user1802174
  • 273
  • 3
  • 10
1
vote
2 answers

How to insert only new and/or updated lines into another file

First days dealing with Perl and blocked already :) Here's the situation: a file is updated in folder A but also exists in folders B, C & D and, to make it easier, it can be different in all of them so I can't just do a diff. New lines that are…
1
vote
1 answer

Backup dirs and subdirs using Python; Use os.walk or filecmp.dircmp, or something else

I am a python newbie. My question is what approach I should use to set up a file/directory backup routine, as described below (os.walk or filecmp.dircmp, or something else). I want to set up a backup routine as follows: Every night, I want to…
Marc B. Hankin
  • 771
  • 3
  • 15
  • 31
1
vote
1 answer

Compare compressed files with gzip and filecmp modules returns False on python 3.10

When I run the following code on python3, the result of the filecmp() is False. Why is it so? I thought compressing twice the same file would output two files with the same exact content. import filecmp import shutil import gzip with…
1
vote
1 answer

To print unmatched values when compared from files using awk/diff/sed/grep

I was trying to print some un-matching strings from two files, where in my first file is having string with some integer values separated with spaces, also my second file is having some string values which matches with some of string values from…
AK90
  • 428
  • 1
  • 4
  • 16
1
vote
2 answers

To extract field from JSON file comparing it with plain text file matching values and extract specific field from JSON file

I have file1.json and plain text file2, Where using file2 values compare with file.json with matching values of file2 there will be the corresponding field which is CaseID in file1.json the resultant file should consist of those values. I have…
1
vote
1 answer

How to restore the Visual Studio Compare/Merge tool?

I am using Microsoft Visual Studio Professional 2017. I installed KDiff3 compare tool (version 0.9.98) in in my local machine. Now, by default, file comparison (.cs extension) in Visual Studio is happening in KDiff, unlike earlier when it used to…
1
vote
1 answer

Is there API for files comparison in vscode

Since file comparison can be executed from vscode using at least a couple of ways that I am aware of: code --diff file1 file2 command palette: "File: Compare Active File With..." I was wondering if there could be an api for comparing two files…
Andrei
  • 175
  • 1
  • 9
1
vote
2 answers

Comparing files using timestamp in Python

I'm trying to compare my files with the timestamp. For example, there is a directory with files, like a.xls, a.log, a.txtb.xls, b.log, b.txtc.xls, c.log, c.txt here i have to find whether the timestamp(datetime) of a.log and a.txt is greater than…
JoJo
  • 67
  • 8
1
vote
2 answers

Compare two excel files in python

import xlrd wb_1 = xlrd.open_workbook('Book1.xls', on_demand=True) ws_1 = wb_1.sheet_by_name('Sheet3') wb_2 = xlrd.open_workbook('Book2.xls', on_demand=True) ws_2 = wb_2.sheet_by_name('Sheet3') for i in range(ws_1.ncols): col_value1 =…
kar_n
  • 78
  • 7
1
vote
2 answers

CSV File Comparison Algorithm in Python3

I am working on creating a CSV file comparator which can compare files which are more than 300 MB. I have created a the first version which can Compare 2 Large CSV files in which the columns can be in any order but the rows need to be in the exact…
Arijit Das
  • 99
  • 1
  • 4
  • 13
1
vote
0 answers

Command prompt to compare different xml-files in different folders to check differences

I am in a situation where I have a certain bat.file that creates xml-messages. However when me and my colleague use the same data and the same tool to create the messages the amount of the xml-messages aren't the same (they differ with one message).…