LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

split number data string

Solved!
Go to solution

Hi,

 

I have an input data, let's say

 

"012345678"

 

How can I split it into 3 digits data form as

 

"012" '345" "678" ?

0 Kudos
Message 1 of 15
(7,212 Views)

Here is a basic loop which will do what you want.

 

Chunk String.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 15
(7,207 Views)

Hi, 

 

As your suggestion only has 1 output, but I need it to be separated into 3 outputs.

 

It's actually a blood pressure reading as the 1st 3 digits for systolic pressure, 4th-6th digits for the diastolic pressure and the last 3 digits for the mean blood pressure. I need it splited into 3 data and displayed.

 

Thank you very much!


@Mark Yedinak wrote:

Here is a basic loop which will do what you want.

 

Chunk String.png


 

0 Kudos
Message 3 of 15
(7,200 Views)

The output is an array and all three values are there. The first three characters are stored in array[0], the second three characters are in array[1], and so on. This is doing what you need. After the loop has run simply access the individual array elements and display/process them as needed.

 

The array is a generally approach whihc will work with any length string.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 4 of 15
(7,193 Views)
Solution
Accepted by chuah

Seems like you have a fixed format so you could do this.

 

ScanStringDigits.png

Message 5 of 15
(7,189 Views)

Thank you!

0 Kudos
Message 6 of 15
(7,165 Views)

Could I ask what the center function is, that seperates the number? I need to do something similar - split a 4 digit number into 4 digits.

0 Kudos
Message 7 of 15
(6,961 Views)

That would be the Scan From String function.  It is found in the String pallet.


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
Message 8 of 15
(6,949 Views)

Deleted

0 Kudos
Message 9 of 15
(6,941 Views)

Wire the outputs to indicator terminals.  The terminals correspond to indicators on your front panel.  You might want to check out some tutorials such as LabVIEW 101.


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
0 Kudos
Message 10 of 15
(6,938 Views)