0

I use diff to show differences in two files.

I want to show Line number in the result of the source into the output.

Example :

File A.csv

1 Test

2 Essai

3 Same

File B.csv

1 Appli

2 Essai

3 Another

**Diff result**

diff A.csv B.csv

1 Test | Appli

3 Same | Another

Andre Kouame
  • 139
  • 1
  • 7

1 Answers1

0

This is an example where you could use the technique of What is "NR==FNR" in awk?
Another solution might be

paste -d"|" A.csv B.csv | nl |  grep -Ev '^(\s*[0-9]*\s*)(.*)\|\2$'
Walter A
  • 19,067
  • 2
  • 23
  • 43