I would like to know how could I compare two files (line by line) (*.xml, .m,.txt,...etc) using MATLAB.
file1 = \'toto.xml\';
file2 = \'titi.xml\';
In case that you have a file (or a path) with spaces (like c:\my folder\myfile.m), wrap the file name with quotation mark (") in the DOS command. Note that the apostrophe is still needed:
file_name_1 = 'file 1.txt';
file_name_2 = 'file 2.txt';
[status,result] = system(['fc ', '"', file_name_1, '" "', file_name_2, '"']);
Alternatively, you can put the quotation mark as soon as you define the variable of the file name:
file_name_1 = '"file 1.txt"';
file_name_2 = '"file 2.txt"';
[status,result] = system(['fc ' file_name_1 ' ' file_name_2]);