LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strings

Solved!
Go to solution

data segreegate.png

This is the data to Input String

{ "_id" : ObjectId("5e1568fa5214eb23287f216e"), "Message" : "hellow write to mongo", "LastUpdateDate" : ISODate("2020-01-08T05:30:34.013Z"), "PARAMETERS" : "R current", "LIVE DATA" : 20.0 }

 

want to segregate into 2d Array

 like Message in one box  hello write to mongo in opposite box.... like that need to display data message ,lastupdate & Rcurrent in one coloumn and hellow write to mongo,2020-01-08, 20 on another coloumn

 

Message          Hellow write to mongo

Last update      2020-01-08 5:30

Rcurrent           20.0

 

any suggesions could help& mostwelcome

0 Kudos
Message 1 of 6
(2,291 Views)

The data your receive look a lot like JSON, Why not use the native JSON parsing function?

If the message doesn't change type, you just need to create a cluster with the expect fied names and type and you will obtain a cluster wich will be easier to manipulate.

Search JSON example it should help you start with starting to parse JSON if you are not familiar with it.

0 Kudos
Message 2 of 6
(2,262 Views)
Solution
Accepted by topic author chaitanya_krishna

Hi Krishna,

 

using plain simple string functions:

check.png

As this looks like JSON you might try to explore other features (like specific JSON tools or atleast RegEx-based parsing) too…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 6
(2,259 Views)

hi sir thanks for the reply, could you please segregate the data by using strings or arrays in the Below format it could be a great help to me.

0 Kudos
Message 4 of 6
(2,155 Views)

Hi krishna,

 

as you marked your own message as "Solution" I guess you know how to change my suggestion to your needs…

 

All you need is some additional string parsing (to remove quotation marks and whitespace). The "Live Data" in your last image is formatted differently than in the string example given in your first post: there are also ways to adapt the formatting…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 6
(2,141 Views)

yes  GerdW your solution  helps me to   complete my task

 

#kurdos to you GerdW

0 Kudos
Message 6 of 6
(2,040 Views)