LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
LabVIEW_Addict

String format specifier which reads until carriage return or line feed

Status: Already Implemented

Already available with the format strings given by crossrulz:

%[^\0D\0A\09]
%[^\0D\0A\09]

 

The "%s" format specifier currently reads characters until a space, CR, LF or tab is encountered. This can be quite cumbersome in some cases:

 

Stirng format specifier - old.png

 

It would be nice to have an additional text format specifier to read text until a CR or LF is encountered:

 

Stirng format specifier - new.png

 

An even better solution might be to read text until a character from a user-defined character set is encountered (in this case 0D=CR; 0A=LF; 09=TAB):

 

Stirng format specifier - new 2.png

4 Comments
crossrulz
Knight of NI

You should read the help file.  Use this as the format and it will give you the result you are looking for

%[^\0D\0A\09]
%[^\0D\0A\09]

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
crossrulz
Knight of NI

And here is an example where I did this to get the string until a comma was encountered: http://forums.ni.com/t5/LabVIEW/scan-from-string-with-TRUE-FALSE-and-comma-as-separator/m-p/3215684#...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
LabVIEW_Addict
Member

Yes, you are right ! Thanks for the help !

Darren
Proven Zealot
Status changed to: Already Implemented

Already available with the format strings given by crossrulz:

%[^\0D\0A\09]
%[^\0D\0A\09]