Mercurial > octave
comparison libinterp/corefcn/file-io.cc @ 21548:f044dc45b8b1
doc: grammarcheck and spellcheck new textscan docstring.
* file-io.cc (Ftextscan): grammarcheck and spellcheck new textscan docstring.
* aspell-octave.en.pws: Add new words to Octave custom dictionary.
author | Rik <rik@octave.org> |
---|---|
date | Sun, 27 Mar 2016 21:34:08 -0700 |
parents | ad0599a0acc6 |
children | 990c6c31a684 |
comparison
equal
deleted
inserted
replaced
21547:ad0599a0acc6 | 21548:f044dc45b8b1 |
---|---|
1236 @deftypefnx {} {@var{C} =} textscan (@var{str}, @dots{})\n\ | 1236 @deftypefnx {} {@var{C} =} textscan (@var{str}, @dots{})\n\ |
1237 @deftypefnx {} {[@var{C}, @var{position}, @var{errmsg}] =} textscan (@dots{})\n\ | 1237 @deftypefnx {} {[@var{C}, @var{position}, @var{errmsg}] =} textscan (@dots{})\n\ |
1238 Read data from a text file or string.\n\ | 1238 Read data from a text file or string.\n\ |
1239 \n\ | 1239 \n\ |
1240 The string @var{str} or file associated with @var{fid} is read from and\n\ | 1240 The string @var{str} or file associated with @var{fid} is read from and\n\ |
1241 parsed according to @var{format}.\n\ | 1241 parsed according to @var{format}. The function is an extension of\n\ |
1242 The function is an extension of @code{strread} and @code{textread}.\n\ | 1242 @code{strread} and @code{textread}. Differences include: the ability to\n\ |
1243 Differences include: the ability to read from either a file or a string,\n\ | 1243 read from either a file or a string, additional options, and additional\n\ |
1244 additional options, and additional format specifiers.\n\ | 1244 format specifiers.\n\ |
1245 \n\ | 1245 \n\ |
1246 The input is interpreted as a sequence of \"words\", delimiters\n\ | 1246 The input is interpreted as a sequence of words, delimiters (such as\n\ |
1247 (such as whitespace) and literals.\n\ | 1247 whitespace), and literals. The characters that form delimiters and\n\ |
1248 The characters that form delimiters and whitespace are determined\n\ | 1248 whitespace are determined by the options. The format consists of format\n\ |
1249 by the options.\n\ | 1249 specifiers interspersed between literals. In the format, whitespace forms\n\ |
1250 The format consists of format specifiers interspersed between literals.\n\ | 1250 a delimiter between consecutive literals, but is otherwise ignored.\n\ |
1251 In the format, whitespace forms a delimiter between consecutive literals,\n\ | 1251 \n\ |
1252 but is otherwise ignored.\n\ | 1252 The output @var{C} is a cell array where the number of columns is determined\n\ |
1253 \n\ | |
1254 The output @var{C} is a cell array whose second dimension is determined\n\ | |
1255 by the number of format specifiers.\n\ | 1253 by the number of format specifiers.\n\ |
1256 \n\ | 1254 \n\ |
1257 The first word of the input is matched to the first specifier of the\n\ | 1255 The first word of the input is matched to the first specifier of the format\n\ |
1258 format and placed in the first column of the output;\n\ | 1256 and placed in the first column of the output; the second is matched to the\n\ |
1259 the second is matched to the second specifier and placed in the second column\n\ | 1257 second specifier and placed in the second column and so forth. If there\n\ |
1260 and so forth.\n\ | 1258 are more words than specifiers then the process is repeated until all words\n\ |
1261 If there are more words than specifiers, the process is repeated until all\n\ | 1259 have been processed or the limit imposed by @var{repeat} has been met (see\n\ |
1262 words have been processed or the limit imposed by @var{repeat} has been met\n\ | 1260 below).\n\ |
1263 (see below).\n\ | |
1264 \n\ | 1261 \n\ |
1265 The string @var{format} describes how the words in @var{str} should be\n\ | 1262 The string @var{format} describes how the words in @var{str} should be\n\ |
1266 parsed.\n\ | 1263 parsed. As in @var{fscanf}, any (non-whitespace) text in the format that is\n\ |
1267 As in @var{fscanf}, any (non-whitespace) text in the format that is\n\ | 1264 not one of these specifiers is considered a literal. If there is a literal\n\ |
1268 not one of these specifiers is considered a literal;\n\ | 1265 between two format specifiers then that same literal must appear in the\n\ |
1269 if there is a literal between two format specifiers then that same literal\n\ | 1266 input stream between the matching words.\n\ |
1270 must appear in the input stream between the matching words.\n\ | |
1271 \n\ | 1267 \n\ |
1272 The following specifiers are valid:\n\ | 1268 The following specifiers are valid:\n\ |
1273 \n\ | 1269 \n\ |
1274 @table @code\n\ | 1270 @table @code\n\ |
1275 @item %f\n\ | 1271 @item %f\n\ |
1283 @item %d\n\ | 1279 @item %d\n\ |
1284 @itemx %d8\n\ | 1280 @itemx %d8\n\ |
1285 @itemx %d16\n\ | 1281 @itemx %d16\n\ |
1286 @itemx %d32\n\ | 1282 @itemx %d32\n\ |
1287 @itemx %d64\n\ | 1283 @itemx %d64\n\ |
1288 The word is parsed as a number and converted to int8, int16, int32 or int64.\n\ | 1284 The word is parsed as a number and converted to int8, int16, int32, or\n\ |
1289 If not size is specified, int32 is used.\n\ | 1285 int64. If no size is specified then int32 is used.\n\ |
1290 \n\ | 1286 \n\ |
1291 @item %u\n\ | 1287 @item %u\n\ |
1292 @itemx %u8\n\ | 1288 @itemx %u8\n\ |
1293 @itemx %u16\n\ | 1289 @itemx %u16\n\ |
1294 @itemx %u32\n\ | 1290 @itemx %u32\n\ |
1295 @itemx %u64\n\ | 1291 @itemx %u64\n\ |
1296 The word is parsed as a number and converted to uint8, uint16, uint32 or\n\ | 1292 The word is parsed as a number and converted to uint8, uint16, uint32, or\n\ |
1297 uint64. If not size is specified, uint32 is used.\n\ | 1293 uint64. If no size is specified then uint32 is used.\n\ |
1298 \n\ | 1294 \n\ |
1299 @item %s\n\ | 1295 @item %s\n\ |
1300 The word is parsed as a string, ending at the last character before\n\ | 1296 The word is parsed as a string ending at the last character before\n\ |
1301 whitespace, an end-of-line or a delimiter specified in the options.\n\ | 1297 whitespace, an end-of-line, or a delimiter specified in the options.\n\ |
1302 \n\ | 1298 \n\ |
1303 @item %q\n\ | 1299 @item %q\n\ |
1304 The word is parsed as a \"quoted string\".\n\ | 1300 The word is parsed as a \"quoted string\".\n\ |
1305 If the first character of the string is a double quote (\") then the string\n\ | 1301 If the first character of the string is a double quote (\") then the string\n\ |
1306 includes everything until a matching double quote, including whitespace,\n\ | 1302 includes everything until a matching double quote---including whitespace,\n\ |
1307 delimiters and end of line characters.\n\ | 1303 delimiters, and end-of-line characters. If a pair of consecutive double\n\ |
1308 If a pair of consecutive double quotes appears in the input,\n\ | 1304 quotes appears in the input, it is replaced in the output by a single\n\ |
1309 it is replaced in the output by a single double quote.\n\ | 1305 double quote. For examples, the input \"He said \"\"Hello\"\"\" would\n\ |
1310 That is, the input \"He said \"\"Hello\"\"\" would return the value\n\ | 1306 return the value 'He said \"Hello\"'.\n\ |
1311 'He said \"Hello\"'.\n\ | |
1312 \n\ | 1307 \n\ |
1313 @item %c\n\ | 1308 @item %c\n\ |
1314 The next character of the input is read.\n\ | 1309 The next character of the input is read.\n\ |
1315 This includes delimiters, whitespace and end of line characters.\n\ | 1310 This includes delimiters, whitespace, and end-of-line characters.\n\ |
1316 \n\ | 1311 \n\ |
1317 @item %[...]\n\ | 1312 @item %[@dots{}]\n\ |
1318 @itemx %[^...]\n\ | 1313 @itemx %[^@dots{}]\n\ |
1319 In the first form, the word consists of the longest run consisting of only\n\ | 1314 In the first form, the word consists of the longest run consisting of only\n\ |
1320 characters between the brackets.\n\ | 1315 characters between the brackets. Ranges of characters can be specified by\n\ |
1321 Ranges of characters can be specified by a hyphen;\n\ | 1316 a hyphen; for example, %[0-9a-zA-Z] matches all alphanumeric characters (if\n\ |
1322 for example, %[0-9a-zA-Z] matches all alphanumeric characters\n\ | 1317 the underlying character set is ASCII). Since @sc{matlab} treats hyphens\n\ |
1323 (if the underlying character set is ASCII).\n\ | 1318 literally, this expansion only applies to alphanumeric characters. To\n\ |
1324 Since Matlab treats hyphens literally, this expansion only applies to\n\ | 1319 include '-' in the set, it should appear first or last in the brackets; to\n\ |
1325 alphanumeric characters.\n\ | 1320 include ']', it should be the first character. If the first character is\n\ |
1326 To include '-' in the set, it should appear first or last in the brackets;\n\ | 1321 '^' then the word consists of characters @strong{not} listed.\n\ |
1327 to include ']', it should be the first character.\n\ | 1322 \n\ |
1328 If the first character is '^' then the word consists of characters\n\ | 1323 @item %N@dots{}\n\ |
1329 NOT listed.\n\ | 1324 For %s, %c %d, %f, %n, %u, an optional width can be specified as %Ns, etc.\n\ |
1330 \n\ | 1325 where N is an integer > 1. For %c, this causes exactly N characters to be\n\ |
1331 @item %N...\n\ | 1326 read instead of a single character. For the other specifiers, it is an\n\ |
1332 For %s, %c %d, %f, %n, %u, an optional width can be specified as %Ns etc.\n\ | 1327 upper bound on the number of characters read; normal delimiters can cause\n\ |
1333 where N is an integer > 1.\n\ | 1328 fewer characters to be read. For complex numbers, this limit applies to\n\ |
1334 For %c, this causes exactly the next N characters to be read instead of\n\ | 1329 the real and imaginary components individually. For %f and %n, format\n\ |
1335 a single character.\n\ | 1330 specifiers like %N.Mf are allowed, where M is an upper bound on number of\n\ |
1336 For the other specifiers, it is an upper bound on the\n\ | 1331 characters after the decimal point to be considered; subsequent digits are\n\ |
1337 number of characters read;\n\ | 1332 skipped. For example, the specifier %8.2f would read 12.345e6 as 1.234e7.\n\ |
1338 normal delimiters can cause fewer characters to be read.\n\ | 1333 \n\ |
1339 For complex numbers, this limit applies to the real and imaginary\n\ | 1334 @item %*@dots{}\n\ |
1340 components individually.\n\ | |
1341 For %f and %n, format specifiers like %N.Mf are allowed, where M is an upper\n\ | |
1342 bound on number of characters after the decimal point to be considered;\n\ | |
1343 subsequent digits are skipped.\n\ | |
1344 For example, the specifier %8.2f would read 12.345e6 as 1.234e7.\n\ | |
1345 \n\ | |
1346 @item %*...\n\ | |
1347 The word specified by the remainder of the conversion specifier is skipped.\n\ | 1335 The word specified by the remainder of the conversion specifier is skipped.\n\ |
1348 \n\ | 1336 \n\ |
1349 @item literals\n\ | 1337 @item literals\n\ |
1350 In addition the format may contain literal character strings;\n\ | 1338 In addition the format may contain literal character strings; these will be\n\ |
1351 these will be skipped during reading.\n\ | 1339 skipped during reading. If the input string does not match this literal,\n\ |
1352 If the input string does not match this literal, the processing terminates,\n\ | 1340 the processing terminates, unless @qcode{\"ReturnOnError\"} is set to\n\ |
1353 unless \"ReturnOnError\" is set to \"continue\".\n\ | 1341 @qcode{\"continue\"}.\n\ |
1354 @end table\n\ | 1342 @end table\n\ |
1355 \n\ | 1343 \n\ |
1356 Parsed words corresponding to the first specifier are returned in the first\n\ | 1344 Parsed words corresponding to the first specifier are returned in the first\n\ |
1357 output argument and likewise for the rest of the specifiers.\n\ | 1345 output argument and likewise for the rest of the specifiers.\n\ |
1358 \n\ | 1346 \n\ |
1359 By default, if there is only one input argument, @var{format} is @t{\"%f\"}.\n\ | 1347 By default, if there is only one input argument, @var{format} is @t{\"%f\"}.\n\ |
1360 This means that numbers are read from @var{str} into a single column vector.\n\ | 1348 This means that numbers are read from the input into a single column vector.\n\ |
1361 If @var{format} is explicitly empty, \"\", then textscan will return data\n\ | 1349 If @var{format} is explicitly empty (@qcode{\"\"}) then textscan will\n\ |
1362 in a number of columns matching the number of fields on the first data\n\ | 1350 return data in a number of columns matching the number of fields on the\n\ |
1363 line of the input.\n\ | 1351 first data line of the input. Either of these is suitable only when the\n\ |
1364 Either of these is suitable only if @var{str} contains only numeric fields.\n\ | 1352 input is exclusively numeric.\n\ |
1365 \n\ | 1353 \n\ |
1366 For example, the string\n\ | 1354 For example, the string\n\ |
1367 \n\ | 1355 \n\ |
1368 @example\n\ | 1356 @smallexample\n\ |
1369 @group\n\ | 1357 @group\n\ |
1370 @var{str} = \"\\\n\ | 1358 @var{str} = \"\\\n\ |
1371 Bunny Bugs 5.5\\n\\\n\ | 1359 Bunny Bugs 5.5\\n\\\n\ |
1372 Duck Daffy -7.5e-5\\n\\\n\ | 1360 Duck Daffy -7.5e-5\\n\\\n\ |
1373 Penguin Tux 6\"\n\ | 1361 Penguin Tux 6\"\n\ |
1374 @end group\n\ | 1362 @end group\n\ |
1375 @end example\n\ | 1363 @end smallexample\n\ |
1376 \n\ | 1364 \n\ |
1377 @noindent\n\ | 1365 @noindent\n\ |
1378 can be read using\n\ | 1366 can be read using\n\ |
1379 \n\ | 1367 \n\ |
1380 @example\n\ | 1368 @example\n\ |
1384 The optional numeric argument @var{repeat} can be used for limiting the\n\ | 1372 The optional numeric argument @var{repeat} can be used for limiting the\n\ |
1385 number of items read:\n\ | 1373 number of items read:\n\ |
1386 \n\ | 1374 \n\ |
1387 @table @asis\n\ | 1375 @table @asis\n\ |
1388 @item -1\n\ | 1376 @item -1\n\ |
1389 (default) read all of the string or file until the end.\n\ | 1377 Read all of the string or file until the end (default).\n\ |
1390 \n\ | 1378 \n\ |
1391 @item N\n\ | 1379 @item N\n\ |
1392 Read until the first of two conditions occurs: the format has been processed\n\ | 1380 Read until the first of two conditions occurs: 1) the format has been\n\ |
1393 N times, or N lines of the input have been processed.\n\ | 1381 processed N times, or 2) N lines of the input have been processed. Zero\n\ |
1394 Zero (0) is an acceptable value for @var{repeat}.\n\ | 1382 (0) is an acceptable value for @var{repeat}. Currently, end-of-line\n\ |
1395 Currently, end-of-line characters inside %q, %c, and %[...]$ conversions\n\ | 1383 characters inside %q, %c, and %[@dots{}]$ conversions do not contribute to\n\ |
1396 do not contribute to the line count.\n\ | 1384 the line count. This is incompatible with @sc{matlab} and may change in\n\ |
1397 This is incompatible with Matlab and may change in future.\n\ | 1385 future.\n\ |
1398 @end table\n\ | 1386 @end table\n\ |
1399 \n\ | 1387 \n\ |
1400 The behavior of @code{textscan} can be changed via property-value pairs.\n\ | 1388 The behavior of @code{textscan} can be changed via property/value pairs.\n\ |
1401 The following properties are recognized:\n\ | 1389 The following properties are recognized:\n\ |
1402 \n\ | 1390 \n\ |
1403 @table @asis\n\ | 1391 @table @asis\n\ |
1404 @item @qcode{\"BufSize\"}\n\ | 1392 @item @qcode{\"BufSize\"}\n\ |
1405 This specifies the number of bytes to use for the internal buffer.\n\ | 1393 This specifies the number of bytes to use for the internal buffer.\n\ |
1406 A modest speed improvement is obtained by setting this to a large value\n\ | 1394 A modest speed improvement may be obtained by setting this to a large value\n\ |
1407 when reading a large file, especially the input contains long strings.\n\ | 1395 when reading a large file, especially if the input contains long strings.\n\ |
1408 The default is 4096, or a value dependent on @var{n} is that is specified.\n\ | 1396 The default is 4096, or a value dependent on @var{n} if that is specified.\n\ |
1409 \n\ | 1397 \n\ |
1410 @item @qcode{\"CollectOutput\"}\n\ | 1398 @item @qcode{\"CollectOutput\"}\n\ |
1411 A value of 1 or true instructs textscan to concatenate consecutive columns\n\ | 1399 A value of 1 or true instructs @code{textscan} to concatenate consecutive\n\ |
1412 of the same class in the output cell array.\n\ | 1400 columns of the same class in the output cell array. A value of 0 or false\n\ |
1413 A value of 0 or false (default) leaves output in distinct columns.\n\ | 1401 (default) leaves output in distinct columns.\n\ |
1414 \n\ | 1402 \n\ |
1415 @item @qcode{\"CommentStyle\"}\n\ | 1403 @item @qcode{\"CommentStyle\"}\n\ |
1416 Parts of @var{str} are considered comments and will be skipped.\n\ | 1404 Specify parts of the input which are considered comments and will be\n\ |
1417 @var{value} is the comment style and can be either\n\ | 1405 skipped. @var{value} is the comment style and can be either (1) A string\n\ |
1418 (1) One string, or 1x1 cell string, to skip everything to the right of it;\n\ | 1406 or 1x1 cell string, to skip everything to the right of it; (2) A cell array\n\ |
1419 (2) A cell array of two strings, to skip everything between the first and\n\ | 1407 of two strings, to skip everything between the first and second strings. \n\ |
1420 second strings.\n\ | 1408 Comments are only parsed where whitespace is accepted and do not act as\n\ |
1421 Comments are only parsed where whitespace is accepted, and do not act as\n\ | |
1422 delimiters.\n\ | 1409 delimiters.\n\ |
1423 \n\ | 1410 \n\ |
1424 @item @qcode{\"Delimiter\"}\n\ | 1411 @item @qcode{\"Delimiter\"}\n\ |
1425 If @var{value} is a string, any character in @var{value} will be used to\n\ | 1412 If @var{value} is a string, any character in @var{value} will be used to\n\ |
1426 split @var{str} into words.\n\ | 1413 split the input into words. If @var{value} is a cell array of strings,\n\ |
1427 If @var{value} is a cell array of strings,\n\ | 1414 any string in the array will be used to split the input into words.\n\ |
1428 any string in the array will be used to split @var{str} into words.\n\ | |
1429 (default value = any whitespace.)\n\ | 1415 (default value = any whitespace.)\n\ |
1430 \n\ | 1416 \n\ |
1431 @item @qcode{\"EmptyValue\"}\n\ | 1417 @item @qcode{\"EmptyValue\"}\n\ |
1432 Value to return for empty numeric values in non-whitespace delimited data.\n\ | 1418 Value to return for empty numeric values in non-whitespace delimited data.\n\ |
1433 The default is NaN@.\n\ | 1419 The default is NaN@. When the data type does not support NaN (int32 for\n\ |
1434 When the data type does not support NaN (int32 for example),\n\ | 1420 example), then the default is zero.\n\ |
1435 then default is zero.\n\ | |
1436 \n\ | 1421 \n\ |
1437 @item @qcode{\"EndOfLine\"}\n\ | 1422 @item @qcode{\"EndOfLine\"}\n\ |
1438 @var{value} can be either a emtpy or one character specifying the\n\ | 1423 @var{value} can be either an emtpy or one character specifying the\n\ |
1439 end of line character, or the pair\n\ | 1424 end-of-line character, or the pair\n\ |
1440 @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} (CRLF).\n\ | 1425 @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} (CRLF).\n\ |
1441 In the latter case, any of\n\ | 1426 In the latter case, any of\n\ |
1442 @qcode{\"@xbackslashchar{}r\"}, @qcode{\"@xbackslashchar{}n\"} or\n\ | 1427 @qcode{\"@xbackslashchar{}r\"}, @qcode{\"@xbackslashchar{}n\"} or\n\ |
1443 @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} is counted as a (single)\n\ | 1428 @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} is counted as a (single)\n\ |
1444 newline.\n\ | 1429 newline. If no value is given,\n\ |
1445 If no value is given, @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} is\n\ | 1430 @qcode{\"@xbackslashchar{}r@xbackslashchar{}n\"} is used.\n\ |
1446 used.\n\ | |
1447 @c If set to \"\" (empty string) EOLs are ignored as delimiters and added\n\ | 1431 @c If set to \"\" (empty string) EOLs are ignored as delimiters and added\n\ |
1448 @c to whitespace.\n\ | 1432 @c to whitespace.\n\ |
1449 \n\ | 1433 \n\ |
1450 @c When reading from a character string, optional input argument @var{n}\n\ | 1434 @c When reading from a character string, optional input argument @var{n}\n\ |
1451 @c specifies the number of times @var{format} should be used (i.e., to limit\n\ | 1435 @c specifies the number of times @var{format} should be used (i.e., to limit\n\ |
1452 @c the amount of data read).\n\ | 1436 @c the amount of data read).\n\ |
1453 @c When reading from file, @var{n} specifies the number of data lines to read;\n\ | 1437 @c When reading from file, @var{n} specifies the number of data lines to read;\n\ |
1454 @c in this sense it differs slightly from the format repeat count in strread.\n\ | 1438 @c in this sense it differs slightly from the format repeat count in strread.\n\ |
1455 \n\ | 1439 \n\ |
1456 @item @qcode{\"HeaderLines\"}\n\ | 1440 @item @qcode{\"HeaderLines\"}\n\ |
1457 The first @var{value} number of lines of @var{fid} are skipped.\n\ | 1441 The first @var{value} number of lines of @var{fid} are skipped. Note that\n\ |
1458 Note that this does not refer to the first non-comment lines, but the first\n\ | 1442 this does not refer to the first non-comment lines, but the first lines of\n\ |
1459 lines of any type.\n\ | 1443 any type.\n\ |
1460 \n\ | 1444 \n\ |
1461 @item @qcode{\"MultipleDelimsAsOne\"}\n\ | 1445 @item @qcode{\"MultipleDelimsAsOne\"}\n\ |
1462 If @var{value} is non-zero,\n\ | 1446 If @var{value} is nonzero, treat a series of consecutive delimiters,\n\ |
1463 treat a series of consecutive delimiters, without whitespace in between,\n\ | 1447 without whitespace in between, as a single delimiter. Consecutive\n\ |
1464 as a single delimiter.\n\ | 1448 delimiter series need not be vertically aligned. Without this option, a\n\ |
1465 Consecutive delimiter series need not be vertically @qcode{\"aligned\"}.\n\ | 1449 single delimiter before the end of the line does not cause the line to be\n\ |
1466 Without this option, a single delimiter before the end of the line does\n\ | 1450 considered to end with an empty value, but a single delimiter at the start\n\ |
1467 not cause the line to be considered to end with an empty value,\n\ | 1451 of a line causes the line to be considered to start with an empty value.\n\ |
1468 but a single delimiter at the start of a line causes the line\n\ | |
1469 to be considered to start with an empty value.\n\ | |
1470 \n\ | 1452 \n\ |
1471 @item @qcode{\"TreatAsEmpty\"}\n\ | 1453 @item @qcode{\"TreatAsEmpty\"}\n\ |
1472 Treat single occurrences (surrounded by delimiters or whitespace) of the\n\ | 1454 Treat single occurrences (surrounded by delimiters or whitespace) of the\n\ |
1473 string(s) in @var{value} as missing values.\n\ | 1455 string(s) in @var{value} as missing values.\n\ |
1474 \n\ | 1456 \n\ |
1475 @item @qcode{\"ReturnOnError\"}\n\ | 1457 @item @qcode{\"ReturnOnError\"}\n\ |
1476 If set to numerical 1 or true, return normally as soon as an error\n\ | 1458 If set to numerical 1 or true, return normally as soon as an error is\n\ |
1477 is encountered, such as trying to read a string using @qcode{%f}.\n\ | 1459 encountered, such as trying to read a string using @qcode{%f}. If set to 0\n\ |
1478 If set to 0 or false, return an error and no data.\n\ | 1460 or false, return an error and no data. If set to @qcode{\"continue\"}\n\ |
1479 If set to \"continue\" (default), textscan attempts to continue reading\n\ | 1461 (default), textscan attempts to continue reading beyond the location;\n\ |
1480 beyond the location; however, this may cause the parsing to get out of sync.\n\ | 1462 however, this may cause the parsing to get out of sync.\n\ |
1481 \n\ | 1463 \n\ |
1482 @item @qcode{\"Whitespace\"}\n\ | 1464 @item @qcode{\"Whitespace\"}\n\ |
1483 Any character in @var{value} will be interpreted as whitespace and trimmed;\n\ | 1465 Any character in @var{value} will be interpreted as whitespace and trimmed;\n\ |
1484 The default value for whitespace is\n\ | 1466 The default value for whitespace is\n\ |
1485 @c Note: the next line specifically has a newline which generates a space\n\ | 1467 @c Note: the next line specifically has a newline which generates a space\n\ |
1491 always part of whitespace.\n\ | 1473 always part of whitespace.\n\ |
1492 \n\ | 1474 \n\ |
1493 @end table\n\ | 1475 @end table\n\ |
1494 \n\ | 1476 \n\ |
1495 When the number of words in @var{str} or @var{fid} doesn't match an exact\n\ | 1477 When the number of words in @var{str} or @var{fid} doesn't match an exact\n\ |
1496 multiple of the number of format conversion specifiers,\n\ | 1478 multiple of the number of format conversion specifiers, @code{textscan}'s\n\ |
1497 textscan's behavior depends on\n\ | 1479 behavior depends on whether the last character of the string or file is an\n\ |
1498 whether the last character of the string or file is\n\ | 1480 end-of-line as specified by the @code{EndOfLine} option:\n\ |
1499 an end-of-line as specified by the EndOfLine option:\n\ | |
1500 \n\ | 1481 \n\ |
1501 @table @asis\n\ | 1482 @table @asis\n\ |
1502 @item last character = end-of-line\n\ | 1483 @item last character = end-of-line\n\ |
1503 Data columns are padded with empty fields, NaN or 0 (for integer fields)\n\ | 1484 Data columns are padded with empty fields, NaN or 0 (for integer fields) so\n\ |
1504 so that all columns have equal length\n\ | 1485 that all columns have equal length\n\ |
1505 \n\ | 1486 \n\ |
1506 @item last character is not end-of-line\n\ | 1487 @item last character is not end-of-line\n\ |
1507 Data columns are not padded; textscan returns columns of unequal length\n\ | 1488 Data columns are not padded; @code{textscan} returns columns of unequal\n\ |
1489 length\n\ | |
1508 @end table\n\ | 1490 @end table\n\ |
1509 \n\ | 1491 \n\ |
1510 \n\ | 1492 \n\ |
1511 The second output, @var{position}, provides the position, in characters\n\ | 1493 The second output @var{position} provides the location, in characters\n\ |
1512 from the beginning of the file or string, at which the processing stopped.\n\ | 1494 from the beginning of the file or string, where processing stopped.\n\ |
1513 \n\ | 1495 \n\ |
1514 @seealso{dlmread, fscanf, load, strread, textread}\n\ | 1496 @seealso{dlmread, fscanf, load, strread, textread}\n\ |
1515 @end deftypefn") | 1497 @end deftypefn") |
1516 { | 1498 { |
1517 static std::string who = "textscan"; | 1499 static std::string who = "textscan"; |