Consider a tab-delimited text file, in which a given field may contain a string with commas, e.g.
...
A<tab>B<tab>C,D,E<tab>F
...
Matlab's "readtable" function with delimiter=\t will parse the third field ("C,D,E") into multiple lines, rather than treating it as one field.
That is, the command:
readtable( filename, 'FileType', 'text', 'Delimiter', '\t', 'ReadRowNames', 0 , 'ReadVariableNames', 0)
will NOT return a table with the 3rd column/Variable having value "C,D,E" but rather split that field into multiple lines/entries (very strange).
3 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_310682
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_310682
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_310689
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_310689
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_311298
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/243638-readtable-bug-with-tab-delimiter-and-commas-within-a-field#comment_311298
Sign in to comment.