Daily I am running approx 100 queries in a script that each produce a single value output (a number). I'm currently outputting each query's value to multiple files, appending each days' output to the bottom of the query's respective file:
query1 goes to file1
date value
Jan-01 35
Jan-02 74
query2 goes to file2
date value
Jan-01 834
Jan-02 342
etc
What I would like is to build a single file that contains a column for each query and append the results accordingly:
Date Query1 Query2 etc
Jan01 35 834 etc
Jan02 74 342 etc
My current query:
query `yesterday` direct | awk '$1=="FA"{count++}END{print count}' > /x/2018/files/"$file1"
query `yesterday` direct | awk '$1=="FM"{count++}END{print count}' > /x/2018/files/"$file2"
query `yesterday` direct | awk '$1=="FT"{count++}END{print count}' > /x/2018/files/"$file3"
(queryDate; query1; query2; query3 ...) | xargs >> master_fileperhaps?