3 deleted 250 characters in body; edited tags
source | link

I have two files A and B which are almost same with some lines different and with some lines jumbled. Since the two files are systemverilog files the lines also contain special characters like ; , = +; , = + and etc I.

I want to loop through each line of file AfileA and check if there is a corresponding match in file BfileB. The comparison should follow the rules

  1. SpaceWhitespaces at the beginning and end of the line can be ignored.
  2. Multiple spaceSpace/tabTab between words can be considered as single spaceSpace.
  3. Empty lines can be ignored

The result should display the lines that are present in file AfileA but not in file BfileB.

I need a script(either python or perl or shell or anything else ) that can run on most linux machines without requiring to install some packages.

I tried tkdifftkdiff but since some lines are jumbled it shows many differences

The lines that are present in B but not in A is also of interest but that I can get by interchanging A and B.  

I have two files A and B which are almost same with some lines different and with some lines jumbled. Since the two files are systemverilog files the lines also contain special characters like ; , = + etc I want to loop through each line of file A and check if there is a corresponding match in file B. The comparison should follow the rules

  1. Space at the beginning and end of the line can be ignored.
  2. Multiple space/tab between words can be considered as single space.
  3. Empty lines can be ignored

The result should display the lines that are present in file A but not in file B.

I need a script(either python or perl or shell or anything else ) that can run on most linux machines without requiring to install some packages.

I tried tkdiff but since some lines are jumbled it shows many differences

The lines that are present in B but not in A is also of interest but that I can get by interchanging A and B.  

I have two files A and B which are almost same with some lines different and with some lines jumbled. Since the two files are systemverilog files the lines also contain special characters like ; , = + and etc.

I want to loop through each line of fileA and check if there is a corresponding match in fileB. The comparison should follow the rules

  1. Whitespaces at the beginning and end of the line can be ignored.
  2. Multiple Space/Tab between words can be considered as single Space.
  3. Empty lines can be ignored

The result should display the lines that are present in fileA but not in fileB.

I tried tkdiff but since some lines are jumbled it shows many differences.

2 edited title
| link

How can I compare two files line by line?

1
source | link

compare two files line by line

I have two files A and B which are almost same with some lines different and with some lines jumbled. Since the two files are systemverilog files the lines also contain special characters like ; , = + etc I want to loop through each line of file A and check if there is a corresponding match in file B. The comparison should follow the rules

  1. Space at the beginning and end of the line can be ignored.
  2. Multiple space/tab between words can be considered as single space.
  3. Empty lines can be ignored

The result should display the lines that are present in file A but not in file B.

I need a script(either python or perl or shell or anything else ) that can run on most linux machines without requiring to install some packages.

I tried tkdiff but since some lines are jumbled it shows many differences

The lines that are present in B but not in A is also of interest but that I can get by interchanging A and B.