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
(2,413 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 LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 2 of 6
(2,409 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
LabVIEW 2017
LabVIEW Programming
Message 3 of 6
(2,390 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
(2,373 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
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 5 of 6
(2,368 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
(2,317 Views)