annotate bin/doS2C.sh @ 152:0072e4ee6c67

use sqlite3 just to tabulate
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Thu, 28 Oct 2021 12:11:08 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
152
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 #!/usr/bin/bash
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 # Usage: doS2C.sh node task cc resdir segs workd dbfile
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 node=$1
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 task=$2
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 cc=$3
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 resdir=$4
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 segs=$5
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8 workd=$6
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 dbfile=$7
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 f=${dbfile%.db}
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 i=${f#*cdx}
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 echo "> $node.$task: $segs $i"
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 sqlite3 $dbfile ".mode csv" ".once $workd/$i.csv" "select count(*),* from props group by segment,ftype,https,nlangs" ".quit"
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 echo "< $node.$task: $segs $i";
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19
0072e4ee6c67 use sqlite3 just to tabulate
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20