Questions tagged [sdiff]

Refers to the command used to merge two files interactively. It is part of GNU diffutils package.

The sdiff command merges two files and interactively outputs the results. It is one component of GNU diffutils package (usage reference).

22 questions
50
votes
4 answers

How to display line numbers in side by side diff in unix?

The scenario is that i have 2 files which i want to diff side by side using the following command with the line numbers: diff -y file1.txt file2.txt and sdiff file1.txt file2.txt The above command just prints the side by side diff but doesn't…
nomazoma49
  • 525
  • 1
  • 4
  • 6
20
votes
4 answers

How to use Python's difflib to produce side-by-side comparison of two files similar to Unix sdiff command?

I am using Python 2.6 and I want to create a simple GUI with two side-by-side text panes comparing two text files (file1.txt & file2.txt) . I am using difflib but it is not clear for me how to produce a result similar to the sdiff Unix command.…
zml
  • 617
  • 7
  • 14
6
votes
1 answer

Colored, side by side, inline git diff output in my terminal

Please note this question is not a duplicate of, but a followup to the question "How can I get a side-by-side diff when I do “git diff”?". This question seeks new information and the solution to a problem. Also, please note that I am seeking only…
Jonah
  • 15,806
  • 22
  • 87
  • 161
4
votes
1 answer

Line numbers with side-by-side diff

I want to write a shell script that diffs two files, and dump the result into another file. I find sdiff to be more intuitive than just diff. However, sdiff doesn't print out the line numbers of where the differences are. I also tried vimdiff,…
jh314
  • 27,144
  • 16
  • 62
  • 82
3
votes
1 answer

Unix diff side-by-side with context

In Unix, execute diff -y file1 file2 can see two files side-by side. And execute diff -c file1 file2 can see two files' difference with 3 line context. Execute diff -y --supress-common-lines can suppress all the common lines. But what if I want…
Dmitrii2333
  • 323
  • 1
  • 5
  • 7
3
votes
2 answers

Is there a way to color highlight difference while using sdiff?

I'm comparing two files using sdiff to get side by side difference but I want the difference to be color highlighted. Ex: File A: Hello There! General Kenobi! Magic File B: Hello World! Hola Magic Now the output from sdiff will be: Hello There!…
manly
  • 49
  • 3
3
votes
0 answers

Perl Algorithm::Diff - treat predefined changes as unchanged

I'm comparing a template to the output based on that template, so I need to produce sdiff output that is tolerant of specified changes; essentially I want the template line: Foo bar blarg [TAG] lorem ipsum to match any of Foo bar blarg .+ lorem…
MilitaryCoo
  • 111
  • 1
  • 7
3
votes
2 answers

Finding the differences of two variables containing strings unix

How i use diff for variables instead of files. All tutorials have examples with files but not with variables. I want it to print just the differences. for example: TEXTA=abcdefghijklmnopqrstuvxyz; TEXTB=abcdefghijklmnopqrstuvxyr
Tamalero
  • 471
  • 1
  • 7
  • 14
2
votes
6 answers

how to compare values between two files?

I have two files with two columns separated by space cat file1.txt 281475225437349 33,32,21,17,20,22,18,30,19,16,23,31 281475550885480 35,32,33,21,39,40,57,36,41,17,20,38,34,37,16,99 cat file2.txt 281475550885480…
1
vote
1 answer

Bash Script using sdiff to compare content from two remote urls

I am trying to use a simple bash command to cause the sdiff of two curl requests $ sdiff -l -w 140 $(curl -s "https:/URL/1/2/thing.php?d=20190202") \ $(curl -s "https:/URL/1/2/thing.php?d=20190203") If I download the two curl…
Matt
  • 133
  • 1
  • 4
  • 13
1
vote
0 answers

How to display line numbers in side by side diff of folders in unix?

I want to display line numbers associated to the files in a recursive side by side diff between two directories. To display line numbers of files in a diff, the command i use is: diff -y <(cat -n abc1.txt) <(cat -n abc2.txt) But in case of…
nomazoma49
  • 525
  • 1
  • 4
  • 6
1
vote
0 answers

How to display [not generate] line numbers of files in side by side diff in unix?

I have 2 files for which i want to diff side by side using the following command with the line numbers: diff -y abc1.txt abc2.txt The above command just prints the side by side diff but doesn't display the line numbers associated with the files. I…
Ronit Mishra
  • 105
  • 11
1
vote
0 answers

Get 'warning: Insecure world writable dir' as 'stderr' when using system "sdiff" in rake

I got the error stderr: ..../file.rb:66 : warning: Insecure world writable dir ... when I ran the integration test to test the code. And in line 66 of that file.rb, I have system "sdiff /tmp/download/file1.json /tmp/download/file2.json" The…
Cloud_cal
  • 132
  • 2
  • 12
0
votes
1 answer

Which redis funtionality is similar to SDIFF for SortedSets

Observations : 1. SDIFF only works with Set. It doesn't support SortedSets. Query : In absence of SDIFF, what can be used for Sorted set for similar use-case as SDIFF
martin
  • 49
  • 2
  • 10
0
votes
1 answer

sdiff via php (without shell)

Anyone familiar with an equivalent of sdiff (or even diff) but executed via PHP. Note: I cannot use shell_exec() to execute a bash script. Right now I am pulling in two pages and want to compare to see what the delta is. appreciated I am trying to…
Matt
  • 133
  • 1
  • 4
  • 13
1
2