With the following files I notice different behaviour of "readtable" in different MATLAB releases:
% File 1: readtable_test1.txt
id another_string age100 10101 grr" 1102 "grr2" 2
% File 2: readtable_test2.txt
id another_string age100 10101 grr" 1102 "grr2" 2103 "grr3 3
% File 3: readtable_test3.txt
id another_string age100 10101 grr" 1102 "grr2" 2103 "grr3 3104 grr"4 4
When running:
readtable('readtable_test1.txt','Delimiter','\t')R2014a and R2014b both produce the same output.
With:
readtable('readtable_test2.txt','Delimiter','\t')
R2014a reads the table without issues, considering the double quotes (") to be part of the field. 2014b most likely considers a " to be a delimiter, and produces an error due to failure to close the quote.
And for:
readtable('readtable_test3.txt','Delimiter','\t')
R2014a and R2014b both run successfully, but produce difference output. R2014a considers all double quotes to be part of the string fields defined by tab delimiters, and reads the table without trouble. R2014b incorporates multiple table rows, despite tab delimiters, into a single table entry.
This behavior appears to be inconsistent and I would like to understand why.
Best Answer