I have a text file whose contents looks like this:
{"result":"true","last":0.02094,"high":0.0213,"low":0.01682,"avg":0.01871,"sell":0.02094,"buy":0.02054,"vol_ltc":5145.8262,"vol_btc":96.29887,"rate_change_percentage":"23.47"}`
(This is data from an API)
I want it formatted so my program can read it, but I need to extract the numbers because some of the exchanges are formatted differently by the API, for example, this:
{"result":"true","last":"0.00000070","high":"0.00000073","low":"0.00000069","avg":"0.00000071","sell":"0.00000071","buy":"0.00000069","vol_doge":71072621.657,"vol_btc":50.64272,"rate_change_percentage":"0.00"}
(Difference: quotes around price values)
And I need something that looks like this:
(Using the first one)
0.02094
0.0213
0.01682
0.01871
0.02094
0.02054
5145.8262
96.29887
23.47
Alternatively something like this (again, using the first one)
last
0.02094
high
0.0213
low
0.01682
avg
0.01871
sell
0.02094
buy
0.02054
vol_ltc
5145.8262
vol_btc
96.29887
rate_change_percentage
23.47
If you need more examples of strings provided from the API, go to http://data.bter.com/api#tickers