cancelar
Mostrando los resultados de 
Buscar en lugar de 
Quiere decir: 

How to extract individual TCP Packet values?

¡Resuelto!
Ir a solución

Hi to all!

Im dealing with a situation where i need to extract individual values in order to insert into a sql database.

Im sucessfully receiving the packet, and the values i need to insert are between { xxxxxxxxxxxxxxxx }, each value name (column name) is delimited between "xxxxxxxx", and also its value.

im pasting the packet received:

 

{ "Address" : "0xC800A8C0", "Channel" : 0, "Descrip" : "DDNS", "Event" : "Update", "SerialID" : "000b3d016ce3", "StartTime" : "2011-12-01 20:04:51", "Status" : "Start", "Type" : "Log" }

 

how can i extract column names and values from the string received?

for example: "Address" : "0cC800A8C0" -------------- the column name is Address and the value is 0cC800A8C0, etc, etc... each field is separated with a "," and each row is delimited between { }

i need to insert only 0cC800A8C0 in Address column (and all the other values), but without " " and without : ... please note that Channel : 0 , the 0 does not have "" because its a numeric value, the rest are strings.

any help on this?

 

thanks in advance!

0 kudos
Mensaje 1 de 5
3.321 Vistas

Give this a try. This will separate the data into a 2D array with the first column containing the column name and the second column containing the data. If you need to process multiple rows in one string you will need to wrap this code in another loop that will extract each data row.

 

DB Parser.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
0 kudos
Mensaje 2 de 5
3.317 Vistas

thanks mark!

can you please attach it in LV 10.0 format as it is in 11.0 and i have 10.0

 

thanks!

0 kudos
Mensaje 3 de 5
3.313 Vistas
Solución
Aceptado por el autor del tema nickpuy

Here you go.

 



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
0 kudos
Mensaje 4 de 5
3.311 Vistas

thank you very much!

0 kudos
Mensaje 5 de 5
3.302 Vistas