![]() ![]() When the number of words in str doesn’t match an exact multiple of "whitespace" obviously, whitespace cannot be a delimiter then. If whitespace characters are to be kept as-is (inĮ.g., strings), specify an empty value (i.e., "") for "delimiter" is retained as delimiter and removed from the set of Supplied in that case only whitespace explicitly specified in Whitespace is always added to the set of delimiterĬharacters unless at least one "%s" format conversion specifier is Into one space and leading and trailing whitespace is removed. InĮach data field, multiple consecutive whitespace characters are collapsed Processing of special characters like "\t". The string defining whitespace must be enclosed in double quotes for proper If value true (1, default), ignore read errors and return normally.Īny character in value will be interpreted as whitespace and trimmed Treat single occurrences (surrounded by delimiters or whitespace) of the Consecutive delimiter series need not be vertically Treat a series of consecutive delimiters, without whitespace in between,Īs a single delimiter. When the data type does not support NaN (int32 for Value to return for empty numeric values in non-whitespace delimited data. Of delimiter characters cannot be empty if needed Octave substitutes a Specifier is supplied see "whitespace" parameter below. To the set of delimiter characters unless a "%s" format conversion ![]() (2) 2x1 cell string array: Everything between the left and right stringsĪny character in value will be used to split str into words (1) One string, or 1x1 cell string: Skip everything to the right of it Value is the comment style and can be any of the following.Įverything from # characters to the nearest end-of-line is skipped.Įverything from // characters to the nearest end-of-line is skipped.Įverything from % characters to the nearest end-of-line is skipped. Parts of str are considered comments and will be skipped. The behavior of strread can be changed via property-value pairs. (default) read all of the string until the end. Optional numeric argument format_repeat can be used for limiting the This will do if str contains only numeric fields. Output argument and likewise for the rest of the specifiers.īy default, format is "%f", meaning that numbers are read from Parsed word corresponding to the first specifier are returned in the first ![]() In addition the format may contain literal character strings these will be where N is an integer > 1.įor %f, format specifiers like %N.Mf are allowed. Optional width can be specified as %Ns, etc. The word is parsed as a number and converted to int32.įor %s and %d, %f, %n, %u and the associated %*s … specifiers an The word is parsed as a number and converted to double. It may contain any combination of the following specifiers: The string format describes how the words in str should be More words than specifiers, the process is repeated until all words have ![]() Specifier, the second to the second specifier and so forth. The string str is split into words that are repeatedly matched to the : = strread ( str) : = strread ( str, format) : = strread ( str, format, format_repeat) : = strread ( str, format, prop1, value1, …) : = strread ( str, format, format_repeat, prop1, value1, …) The optional second output, matches, returns the delimiters which were
0 Comments
Leave a Reply. |