Questions tagged [jsonreader]

114 questions
18
votes
3 answers

How do you parse a JSON file using JSON.net

I am trying to read a JSON file and parse it. I have this code for reading from my file StreamReader re = new StreamReader("artists.json"); JsonTextReader reader = new JsonTextReader(re); But how do I parse it now from reader so I can search data…
user972616
  • 1,324
  • 3
  • 18
  • 38
10
votes
4 answers

Using GSON do not parse a field, only keep it with the json raw string

Using GSON in Java is there any annotation where I can indicate a field that it should keep it as a raw string even though it is an object. ? Or What would be the easiest way to achieve this? //This is the original @SerializedName("perro") …
Kenenisa Bekele
  • 835
  • 13
  • 34
6
votes
2 answers

C# Error reading JObject from JsonReader. Path '', line 0, position 0

I'm trying to parse my json with the code below. I get the error: Error reading JObject from JsonReader. Path '', line 0, position 0. I thought this might be because my JSON was malformed, so I have output it, and it appears to be ok: { …
hlh3406
  • 1,382
  • 5
  • 29
  • 46
6
votes
2 answers

Reading Large JSON file into variable in C#.net

I am trying to parse the JSON files and insert into the SQL DB.My parser worked perfectly fine as long as the files are small (less than 5 MB). I am getting "Out of memory exception" when trying to read the large(> 5MB) files. if…
user1046415
  • 779
  • 4
  • 23
  • 43
5
votes
1 answer

Handling Null Pointers from JsonReader

I am using JsonReader to fetch lots of data from a website and saving to a db. Incidentally, whenever the reader doesnt find a value for an object item, it fails and stops executing. This is the error i have; System.err﹕…
Alex Kombo
  • 3,256
  • 8
  • 34
  • 67
4
votes
1 answer

Loading a JSON file containing JSON within brackets

I'm trying to load a JSON file on a website using C# and JSON.Net However, I'm running into a problem when it runs because all the JSON is within []. Here's the…
user1104783
  • 155
  • 2
  • 11
4
votes
2 answers

what's basic difference between JsonStore and JsonReader in context to Ext.data?

What's basic difference between JsonStore and JsonReader in context to Ext.data? I mean when I should go for JsonStore and when I should use JsonReader as for me both are providing same solution.
shahjapan
  • 13,637
  • 22
  • 74
  • 104
3
votes
1 answer

Convert value from JsonObject to BigDecimal

I'm a newbiew in java language. I want to get a value from a JsonObject and convert it to BigDecimal. I have the following code: JsonReader jsonReader; try { jsonReader = Json.createReader(httpRequest.getReader()); } catch (IOException e) { …
Ricardo Rocha
  • 14,612
  • 20
  • 74
  • 130
3
votes
2 answers

How to order and display json values in list, if some values are not unique and some are unique

{ places: [ { id: 1, place:"America", name: "Robert", age: "22", place_lat: "10.017", place_lon: "76.344" }, { id: 1, place:"America", name: "Albert", age: "22", place_lat: "10.017", place_lon: "76.344" }, { id: 2, place:"China", name:…
Visal Varghese
  • 436
  • 5
  • 14
3
votes
2 answers

GSON: END_OBJECT never get called

I have a JSON like: {"aData": {"tournaments": {"new":[ {"token":"1-token", "prio":"6", "status":"inactive", ..., "_timeCreated":"2014-04-14 14:44:49", "_timeChanged":"2014-08-08…
injecteer
  • 20,038
  • 4
  • 45
  • 89
3
votes
1 answer

android JSON reader - IllegalStateException; expected name but was string

I'm trying to use a Json Reader to parse through a .json file to insert records into my database but i'm having a problem reading through the file. I intentionally opened the methods for parsing/reader with a try/catch clause so i can see what the…
Matthew White
  • 199
  • 3
  • 11
3
votes
1 answer

How can I skip unwanted values using JsonReader?

I was trying to parse a JSON file with JsonReader. I use the skipvalue() function to go to the next key, but instead of going to the next key, the parser jumps to the end of file. The file looks like this: { "data":{ "current_condition":[ …
user2013423
  • 31
  • 1
  • 2
2
votes
0 answers

How can I pass input stream to Utf8JsonReader in C#?

So I am trying to read in a serialized JSON file. So a part of my code currently looks like this using (Stream input = File.OpenRead(openDialog.FileName)) using (BinaryReader reader = new BinaryReader(input)) This is part of a larger project. Per…
Connor
  • 113
  • 8
2
votes
1 answer

How to load a json file which is having double quotes within a string into a dataframe in spark scala

I have the below json file which i want to read into a dataframe but i wm getting error as the json file has double quotes within the string.for example: data:{ "Field1":"val"ue 1", "Field2":"value2", "Field3":"va"lu"e3" } Required…
Monika
  • 45
  • 2
2
votes
1 answer

Ext JS: Override JsonReader or post-process

A particular request to my server returns x fields of JSON. I want to combine several of these fields and insert the concatenated data into the x+1 field of my JsonStore. I know how to process the load event, read each record, concatenate the…
Upperstage
  • 3,747
  • 8
  • 44
  • 67
1
2 3 4 5 6 7 8