Contents Previous Next Subchapters

Print the Differences Between Ascii Files
Syntax filediff(fxfynrnc)
See Also update

Prints the difference between two ASCII files or directories. The character row vector fx specifies the first file or directory. The character row vector fy specifies the second file or directory. The integer scalar nr specifies the number of rows of a file that must match when realigning files. This must be greater than or equal one. The integer scalar nc specifies the number of columns, from each row, to include in the pattern matching. If a row does not have enough columns, it is blank filled. If the argument ext is present, both fx and fy must be directories. In this case only subdirectories and files with extension equal to ext are compared. In this context, the extension of a file name is any sequence of characters at the end of the file name including one or more periods if so desired.

Suppose that the file temp.1 contains the text
     line one.
     line two.
     line three.
     line four.
and the file temp.2 contains the text
     line one.
     line three.
     line four.
     line five.
If you enter
     fx = "temp.1"
     fy = "temp.2"
     nr = 2
     nc = 80
     filediff(fx, fy, nr, nc)
O-Matrix will respond
     difference: temp.1 <> temp.2
     <line two.
     >line five.
The < character is printed in front of text that is in the first file and not the second while the > character is printed in front of text that is in the second file and not the first.