Hi!--
I receive a return value from a RF library like this {"id":"7e48b23e-5c52-46a5-be6b-6cf904a2b3c3","name":"Some","created":"2014-12-30T18:00:32.349Z","updated":"2014-12-30T18:00:32.349Z","tags":[],"type":"All","parameters":{"Scope":"*","Target":"ALL"}}
That *should ideally* be a json formatted string, but as far as I can see it is just a string. And I'm trying to extract the value of the 'id'. Thus, 7e48b23e-5c52-46a5-be6b-6cf904a2b3c3
The string generated above is random and will be different each time, except the keys that will remain the same
I cannot figure this out. Anybody who can help?
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
I'm a bit rusty on my GREP skills, but in general I'd approach this by selecting all the characters up to the first comma, then remove the first 7 characters ( {"id":" ) and the last character (").This of course assumes the ID always comes first in your output string.If the order varies you'd have to first find the string that is between "id":" and the next instance of ", That should actually be more efficient, as you should be able to do that in one step.This also assumes that no other part of the returned string will ever contain the particular string "id":" and that your target string will never contain ",
On Tue, Dec 30, 2014 at 12:13 PM, komodospider <sbk...@gmail.com> wrote:
Hi!
I receive a return value from a RF library like this {"id":"7e48b23e-5c52-46a5-be6b-6cf904a2b3c3","name":"Some","created":"2014-12-30T18:00:32.349Z","updated":"2014-12-30T18:00:32.349Z","tags":[],"type":"All","parameters":{"Scope":"*","Target":"ALL"}}
That *should ideally* be a json formatted string, but as far as I can see it is just a string. And I'm trying to extract the value of the 'id'. Thus, 7e48b23e-5c52-46a5-be6b-6cf904a2b3c3
The string generated above is random and will be different each time, except the keys that will remain the same
I cannot figure this out. Anybody who can help?
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
I'm a bit rusty on my GREP skills, but in general I'd approach this by selecting all the characters up to the first comma, then remove the first 7 characters ( {"id":" ) and the last character (").This of course assumes the ID always comes first in your output string.If the order varies you'd have to first find the string that is between "id":" and the next instance of ", That should actually be more efficient, as you should be able to do that in one step.This also assumes that no other part of the returned string will ever contain the particular string "id":" and that your target string will never contain ",
On Tue, Dec 30, 2014 at 12:13 PM, komodospider <sbk...@gmail.com> wrote:
Hi!
I receive a return value from a RF library like this {"id":"7e48b23e-5c52-46a5-be6b-6cf904a2b3c3","name":"Some","created":"2014-12-30T18:00:32.349Z","updated":"2014-12-30T18:00:32.349Z","tags":[],"type":"All","parameters":{"Scope":"*","Target":"ALL"}}
That *should ideally* be a json formatted string, but as far as I can see it is just a string. And I'm trying to extract the value of the 'id'. Thus, 7e48b23e-5c52-46a5-be6b-6cf904a2b3c3
The string generated above is random and will be different each time, except the keys that will remain the same
I cannot figure this out. Anybody who can help?
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.