LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parsing carriage return characters

Hello
 
I am writing a program to parse fields in messages. The messages look like this:
 
Field 1.1|Field 1.2|Field 1.3| ... |Field 1.n<carriage return character>
Field 2.1|Field 2.2|Field 2.3| ... |Field 2.n<carriage return character>
 
To parse this, i used the "Scan string for Tokens" VI, using "|" and "\r" as delimiters, storing all the field in an array. The implementation can be seen in the attachment
 
The pipe character works fine, but the carriage return does not.
 
I get this at the end of each line:
 
"Field 1.n
Field 2.1"
 
The program is not using the carriage return character as a delimiter. I am using LabView 7.0 Express.
 
Can somebody tell me what is wrong?
 
Thanks in advance
0 Kudos
Message 1 of 4
(2,834 Views)
Make sure that the elements in the Delimiters array have the "\" Codes Display option enabled (to set, right click on any element), then re-enter the \r constant.
It works for me.

Paolo

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 4
(2,822 Views)
I am using | and \r as delimiters. It has the backslash character. I don't understand why this does not work.
0 Kudos
Message 3 of 4
(2,820 Views)

I already got it.

I didn't know i had to enable an option to make the program interpret \r as a carriage return.

Thanks, Paolo

0 Kudos
Message 4 of 4
(2,815 Views)