I get the data with wget.
Example of the output:
[{"id":15654014,"price":6.3e-06,"amount":1.7,"total":1.071e-05,"market":"somebtc","created_at":1622541615,"taker_type":"buy"}]
The goal is to get the price value which is the 6.3e-06
, so the pattern is "price":
, but the next pattern is to get everything until we reach ,
so we can be sure that we take only the price
My solution:
cat price.txt | cut -c25- | sed 's/.//9g' > pricefin.txt
So I basically remove the first 25 charachters and then remove everything except the first 9.
However the value of 6.3e-06
can be sometimes less or more than just 9.
What can be the solution in my case?