LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parsing string data

Solved!
Go to solution

Hi all,

I received data string from serial communation in this format:

 Fuse    Bridge   HtrPwrV  VDispV/C DTP V/C  DTM V/C  DiffC  TempC
 OK      VALID     0.95     1.80     3.16     0.53     537   29.6
                                           369      647      110

And I want to extract certain value out of this. I realized that they are seperated by space characters between them. So I was thinking about transfer them into an array, and then extract certain row/column from there. But I don't know how to get it done.

Could you give me some idea. Or if you have a better way, then please show me!

Thanks

 

0 Kudos
Message 1 of 14
(6,557 Views)
Is it a constant number of spaces between each object, or is it variable. Which labview version do you use?


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 14
(6,552 Views)
Just use Spreadsheet String to array with a space as a delimiter.
0 Kudos
Message 3 of 14
(6,551 Views)

Dennis Knutson wrote:
Just use Spreadsheet String to array with a space as a delimiter.
That will only work if the number of spaces is constant between each data item, in every string received.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 14
(6,542 Views)

No it is not a constant # of spaces , and sometimes even has carriage return and/or new line also. I'm using LV 8.5.

Thanks

0 Kudos
Message 5 of 14
(6,536 Views)

How exactly are you receiving the data? As one long string? There is the Search and Replace Pattern function where you can use an expression.

 

Why don't you attach an actual string that you are getting? You can copy the string from your VI into a text file or attach the VI wi data in a string indicator. Run the VI then select Edit>Make Current Values Default. Save that VI and attach it.

0 Kudos
Message 6 of 14
(6,527 Views)
Here is the actual string that I received. One in normal display and one is code display.
0 Kudos
Message 7 of 14
(6,513 Views)
Those are NOT the actual strings you receive. Those are images in a word file. What kind of string parsing can anyone do with an image?
0 Kudos
Message 8 of 14
(6,505 Views)
Sorry, I misunderstood your request. Here it is.
0 Kudos
Message 9 of 14
(6,498 Views)
Solution
Accepted by topic author dphan128
Here's one way.
Message 10 of 14
(6,491 Views)