MATLAB COMPILER RELEASE NOTES User's Guide Page 71

  • Download
  • Add to my manuals
  • Print
  • Page
    / 716
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 70
Data Import and Export
1-15
textscan and readtable Functions: Return consistent results when
reading quoted strings
As of R2014b, using the %q format specifier with the textscan and readtable
functions returns consistent results. When using %q to read strings that begin with
a double quotation mark ("), textscan and readtable remove the leading double
quotation mark and its accompanying closing mark. The closing mark is the second
instance of a lone, unescaped double quotation mark. The functions replace escaped
double quotation marks (for example, ""abc"") with lone double quotation marks
("abc"). The textscan and readtable functions ignore any double quotation marks
that follow the closing mark.
In R2014a and earlier, the textscan and readtable functions return unpredictable
results when reading strings with extraneous double quotation marks. This behavior can
occur when you use the %q format specifier or if you do not specify a value for the Format
name-value pair argument to readtable.
For example, these commands:
C = textscan('"Alvin ""Al"" Smith"','%q','Delimiter',',');
C1 = C{:}
D = textscan('"Alvin" "Al" Smith"','%q','Delimiter',',');
D1 = D{:}
E = textscan('"Alvin ""Al"" Smith" and Brian"""Jones','%q','Delimiter',',');
E1 = E{:}
now return:
C1 =
'Alvin "Al" Smith'
D1 =
'Alvin "Al" Smith"'
E1 =
'Alvin "Al" Smith and Brian"""Jones'
In R2014a and earlier, the same commands return:
C1 =
'Alvin "Al" Smith'
D1 =
'Alvin "Al Smith"'
E1 =
'Alvin "Al" Smith and Brian""Jones'
Page view 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 715 716

Comments to this Manuals

No comments