changeset 4:f27061e8a9da

convert to no longer need uniq -c
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 20 Jul 2022 19:38:30 +0100
parents 668579197bec
children f035d36cec45
files bin/_nl1.sh
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bin/_nl1.sh	Tue Jul 19 11:02:41 2022 +0100
+++ b/bin/_nl1.sh	Wed Jul 20 19:38:30 2022 +0100
@@ -30,7 +30,7 @@
  echo $(date) start $1 $task $PARALLEL_SEQ 1>&2
  fgrep '	w	' $srcdir/$1.tsv | \
    awk 'BEGIN {while (getline < "'$langfile'") {l[$0]=1}}
-        {if (l[$4]) {print $1,$4}}' | uniq -c | \
+        {if (l[$5]) {print $1,$2,$5}}' | \
     $W/shared/bin/uniq_merge.py > $resdir/${langs}_$1.tsv
  echo $(date) end $1 $task $PARALLEL_SEQ 1>&2
 }
@@ -38,12 +38,7 @@
 export -f doit
 export srcdir resdir task langs langfile
 
-seq $s1 $sn | while read i
- do if [ $((i % $n)) -eq $task ]
- then printf '%03g\n' $i
- fi
- done | \
-   parallel -j $pjobs doit '{}'
+$W/hst/bin/share_by_task.sh -f "%03g\n" -s $s1 $sn $n $task | parallel -j $pjobs doit '{}'
 
 echo $(date) task $n.$task on $nodename:$N.$node end 1>&2