From aada9aab955ff5dabb7461795218e0b345bb58d8 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 8 Sep 2021 12:50:12 +0200 Subject: tasks: try tsv plus tr; cf: https://github.com/stedolan/jq/issues/1735#issuecomment-661623119 --- python/refcat/techreport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/refcat/techreport.py b/python/refcat/techreport.py index 48c1084..beb0500 100644 --- a/python/refcat/techreport.py +++ b/python/refcat/techreport.py @@ -39,7 +39,8 @@ class BrefDOIOnly(Refcat): def run(self): output = shellout(r""" zstdcat -T0 {input} | - parallel --pipe -j 16 --block 10M "jq -rc '[.source_doi, .target_doi] | @csv'" | + parallel --pipe -j 16 --block 10M "jq -rc '[.source_doi, .target_doi] | @tsv'" | + tr ' ' ',' | perl -F, -lane 'printf qq[%s\n], join ",", sort @F' | zstd -c -T0 > {output} """, -- cgit v1.2.3