GlobalNamesArchitecture / gnparser

Split scientific names to meaningful elements with meta information
https://parser.globalnames.org/
MIT License
20 stars 2 forks source link

Header on "file" output #438

Closed Mesibov closed 6 years ago

Mesibov commented 6 years ago

When running gnparser with the file command in a BASH shell, stdout has one or more non-JSON header lines (e.g. "Running with parallelism: 4"). These header lines throw up errors in JSON-interpreting programs that use the JSON output from gnparser as stdin. I can remove these header lines if I know how many there are (with tail), but I don't always know that.

alexander-myltsev commented 6 years ago

@Mesibov , please, check the 3854e41773b5725ad1c0b31c5c33fb6914e22c1a . Now gnparser writes its service information to STDERR. You can redirect the STDOUT right to your formatting util:

bash gnparser-0.4.5-SNAPSHOT/bin/gnparser file -i test.txt | python -m json.tool

Also, keep track on the https://github.com/GlobalNamesArchitecture/gnparser/issues/465

All the code would be shipped upon the next release.

Mesibov commented 6 years ago

@alexander-myltsev Many thanks, > stderr is a good solution. Looking forward to the next release.