Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

strread (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: string

Requires: MathScript RT Module

Syntax

c = strread(a)

c = strread(a, '', n)

c = strread(a, '', option, optionvalue)

c = strread(a, '', n, option, optionvalue)

[c1, c2, ...] = strread(a, format)

[c1, c2, ...] = strread(a, format, n)

[c1, c2, ...] = strread(a, format, option, optionvalue)

[c1, c2, ...] = strread(a, format, n, option, optionvalue)

Description

Reads data from an input string according to the format and option you specify.

Details

Examples

Inputs

Name Description
a Specifies the string to read.
format Specifies the pattern to read. format must use appropriate format specifier syntax.
n Specifies the amount of formatted data to read.
option, optionvalue Specify how to treat the characters in a. option is a string that accepts the following values.

'commentstyle' Ignores the characters that follow comment characters. LabVIEW recognizes comment characters according to the language you specify in optionvalue. optionvalue is a string that accepts the following values: 'matlab', 'shell', 'c', or 'c++'.
'delimiter' Treats optionvalue as a new delimiter character.
'expchars' Treats optionvalue as a new exponent character. The default optionvalue is 'e', 'E'.
'whitespace' Treats each character in optionvalue as a new white space character. If optionvalue includes a backslash ('\'), the character after the backslash can be only 'n', 'r', 't', or '\'.

Outputs

Name Description
c, c1, c2, ... Return the formatted data from the input string.

Details

The number of output parameters must equal the number of items in format. If you specify '' instead of format, this function uses '%f' as the default pattern to read.

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

str = sprintf('a, 1, 2\nb, 3, 4\n')
[c1 c2 c3] = strread(str, '%s%d%d', 'delimiter', ',')

Related Topics

sprintf
sscanf
strfindall


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit