hyphy icon indicating copy to clipboard operation
hyphy copied to clipboard

Export table FEL

Open andreaniml opened this issue 2 years ago • 2 comments

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

andreaniml avatar Aug 30 '22 15:08 andreaniml

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

spond avatar Aug 30 '22 16:08 spond

It worked! Thank you very much!

andreaniml avatar Aug 30 '22 16:08 andreaniml

Stale issue message

github-actions[bot] avatar Oct 30 '22 00:10 github-actions[bot]