Suppose there is a JSON file at a particular location. Let's say at "C:\Data\". Using Julia, how do I load the file, so that I may use its content for analysis?
The following link provides access to a sample of my JSON files. For the readers information, I am in the process of learning how to extract market data from Betfair.
Link: Betfair JSON File Example
1 Answer
You just specify the full path to the file to the JSON parser you are working with. For example with the JSON package:
julia> using JSON julia> JSON.parsefile("/Users/fredrik/test.json") # full path Dict{String,Any} with 2 entries: "hello" => 1 "world" => Any[1, 2] If you are running the code in the same directory as the JSON file you can just use the filename since Julia defaults to look in the current directory:
julia> JSON.parsefile("test.json") # relative path Dict{String,Any} with 2 entries: "hello" => 1 "world" => Any[1, 2] 1