#!/bin/bash

infile=a
jq -r '.response.docs[] | .author[]' $infile | sed 's/\.$//' | 
   awk -F, '{printf ("%s", $1) 
      n=split($2,a," ") 
      for (k=1;k<=n;k++){b=substr(a[k],1,1);printf (" %s ",b)} 
      print ""}' |       \
sort |            \
uniq -c |         \
sort -k1nr   | head -n15 | tee CoAuthor.txt      

jq -r '.response.docs[] | .citation[]'  a > citation.txt
jq -r '.response.docs[] | .reference[]'  a > reference.txt


