All Questions
Tagged with diff text-processing
53 questions
1
vote
4
answers
150
views
Find text files where the content is duplicated?
By mistake I appended (>>) rather than overwrote (>) the output from a script that processed thousands of files, but I only did it for about 20 % of the files (I ran 5 parallel instances of ...
-3
votes
2
answers
1k
views
How to get difference of two csv files by columns and write diff into 3rd file?
I have two csv files like this;
422174,XN,20.99,2020-09-01,2022-01-20 20:20:28.613+00
421348,SB,21.99,2021-01-26,2022-01-20 20:20:28.613+00
885176,XN,41.80,2021-11-17,2022-01-20 20:20:28.613+00
881751,...
4
votes
3
answers
849
views
Merging two non-git-based text files with similar semantics to the depiction of git merge conflicts
I would like to merge two non-git-based text files using semantics that are similar to to how git depicts "merge conflicts".
For example, suppose I have two text files with similar but not ...
-1
votes
1
answer
95
views
Search for a patter grep in file
I have the output of diff in the format below:
$ curr_dt=$(date +%m_%d_%Y)
$ echo $curr_dt
$ diff -q /POC/$curr_dt/DDL/ /POC/Backup/DDL/
Only in /POC/Backup/DDL/: comp1.txt
Only in /POC/Backup/DDL/: ...
0
votes
2
answers
201
views
How to compare two tsv extract in Unix and print differences with key and header?
I have two files with same header and structure and the first column is a key.
File 1:
key val1 val2 val3 val4 val5
Item1 10 12 44 88 22
Item2 33 33 43 77 22
Item3 28 44 55 ...
0
votes
2
answers
160
views
get only the unmatched list as an output
I want to know on which ports of firewalls from a particular customer the MAC Address Filtering is not active. So I have created 2 files:
all.txt contains a list of all firewalls of a customer and ...
-1
votes
2
answers
398
views
How to measure the similarity or the distance between human readable text files (license files)?
I want to find out which license a source tree has. The computer should make a suggestion which license files match closely. Then I would like to compare the texts with meld manually.
In a typical ...
1
vote
1
answer
2k
views
diff marking each line as old, new, or unchanged
I need to diff two unsorted text files with the output marking every line as either old, new, or unchanged. The marks should appear at the beginning or end of the line, and there should be no other ...
0
votes
2
answers
318
views
Using sed to cut and add to specific lines of diff output
I have the output from my diff command between two directories store in a file called differenceOutput.txt.
At present there are only two kinds of lines in differenceOutput.txt So all lines have ...
0
votes
1
answer
239
views
comparison of two sorted files by common first field
I have to compare the IPs of two different /etc/hosts files and show a diff in side-by-side view.
File hosts_sorted
10.244.74.152 REF_UP-4
10.244.74.154 REF_UP-5
10.244.74.156 REF_UP-6
10.244....
14
votes
6
answers
6k
views
How to compare two different files line by line in unix?
File1:
123
234
345
456
File2:
123
234
343
758
Expected output:
File3:
TRUE
TRUE
FALSE
FALSE
so the code should compare two files and print 'TRUE' if it matches otherwise it should print 'FALSE' in ...
3
votes
1
answer
4k
views
bash remove common lines from two files
I have two files, (no blank lines/Spaces/Tabs)
/tmp/all
aa
bb
cc
hello
SearchText.json
xyz.txt
/tmp/required
SearchText.json
and the end output I want is : (all uncommon lines from /...
1
vote
2
answers
259
views
Compare every nth line in 2 files and save (asymmetric) context
I have 2 files, each containing the same amount of 4-lines records, in the same order:
fileA:
record1 line1=header
record1 line2 X <= this is different but should be ignored
record1 line3 id ABC
...
3
votes
3
answers
2k
views
How to tell the difference between changed and added lines?
I have two csv files where I want to figure out the deleted, modified and added lines. (The first field is an unique id.)
The first file looks like:
0, WILL_BE_REMOVED
1, OLD
2, SAME
3, SAME
and a ...
0
votes
2
answers
970
views
How can I compare two files by using just two columns and print the difference (without sorting)?
I have two files:
File 1:
No ID CV CA1 CA2
1 transcr_10283 0.999023367236861 -0.344113101336184 -0.032235130455987
2 transcr_10371 -0.572755303094372 -0.579145581184253 0....