12-01-2011 05:12 PM
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!
Solved! Go to Solution.
12-01-2011 05:57 PM - edited 12-01-2011 05:59 PM
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.
12-01-2011 06:12 PM
thanks mark!
can you please attach it in LV 10.0 format as it is in 11.0 and i have 10.0
thanks!
12-01-2011 06:18 PM
Here you go.
12-01-2011 06:59 PM
thank you very much!