LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define end of the multi-line string ?

Solved!
Go to solution

Hi all!

I have a multi-line string, which I am handling by function "Pick line". The multi-line string may be different lenght. How I can to define    end of multi-line string ?

 

Thanking in advance!

0 Kudos
Message 1 of 6
(3,977 Views)

Hi MaxiMuz,

 

in LabVIEW a string is defined by it's length, there is no special "end of string" char similar to a zero byte in other programming environments!

The "end of line" char usually CR…

 

How I can to define end of multi-line string ?

To define the length you could use StringStubset and provide the desired length!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,973 Views)
Solution
Accepted by topic author MaxiMuz1979

You can use the Spreadsheet String to Array with a newline constant as the delimiter to convert your string to an array and then get the array size to determine how many lines are in your string.  Not sure if that is what you are asking.

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 6
(3,954 Views)
How I can to define end of multi-line string ?

To define the length you could use StringStubset and provide the desired length!


That to define the length I must to know this length. For example , I am reading txt-file  by "Read from Text File". Its is multi-line string, and I don't know how many the row it contains.

0 Kudos
Message 4 of 6
(3,937 Views)

Right click the Read from Text File and select Read Lines.  This will read each line of the file into an array index.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 6
(3,932 Views)

@aputman wrote:

You can use the Spreadsheet String to Array with a newline constant as the delimiter to convert your string to an array and then get the array size to determine how many lines are in your string.  Not sure if that is what you are asking.

Example_VI_BD.png

Thanks for the advise !

But , if as delimiter to use the LF(line feed), in this case if last lines are empty, then a last line don't considered.

Properly to use CR (carriage return).

0 Kudos
Message 6 of 6
(3,881 Views)