Message Boards Message Boards

working with files json

Posted 10 years ago

Hi, folks. I am trying to extract parts of a file json, I want a list like the following

{"uri" -> "http://community.wolfram.com/dashboard", 
 "uri" -> "http://www.online-convert.com/es/resultado/d7b9f49e6e811d16d321b597ff024cc4", 
 "uri" -> "https://www.youtube.com/watch?v=_yBxQXombCw", "https://www.youtube.com/watch?v=mFN73-PQX6I", 
 "uri" -> "https://www.youtube.com/watch?v=P0FxZUrIB5M"}

where they are all uris, in the list that I put for example are some, the problem is that I have tried several ways but I have not been able to, I hope that someone can help me.

Here are the steps of my last attempt to try to do my task but I did not obtain success.

impjas = Import[
   "C:\Documents and Settings\luis\Mis \n    documentos\bookmarks-2014-09-05.json"];
base = ToString[impjas];

caseshttp = StringCases[base, "http://" ~~ ___];
In[5]:= StringPosition[caseshttp, "http://" ~~ ___]

Out[5]= {{{1, 29207}, {246, 29207}, {483, 29207}, {659, 29207}, {1060,
    29207}, {1230, 29207}, {7391, 29207}, {10765, 29207}, {11773, 
   29207}, {12359, 29207}, {12534, 29207}}}

caseshttp[[1, 29207]]
Part::partd: Part specification {<<29211>>}[[1,29207]] is longer than depth of object. >>

Thanks in advance,Luis. Attach my file .json

Attachments:
POSTED BY: Luis Ledesma
POSTED BY: David Reiss
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract