hyphy
hyphy copied to clipboard
Export table FEL
Hi
I have the FEL json output and wanted to extract the table that you can see when I input it on hyphy vision (Table 1). My guess is that it must be simple with few lines of code, but I don't know how. Could you point me in the right direction?
Many thanks!
Maria
Dear @andreaniml,
There are many ways to do it (you can write a Python script etc). My preferred method is to use jq, with which you can do the following one line command (replace the name of the file with your FEL.json)
jq '(.["MLE"]["headers"] | map (. | .[0])) as $headers | $headers, .["MLE"]["content"]["0"][] | @csv' -r tests/hbltests/libv3/data/CD2.nex.FEL.json > table1.csv
Best, Sergei
It worked! Thank you very much!
Stale issue message