diff options
Diffstat (limited to 'reproduce/analysis/make')
-rw-r--r-- | reproduce/analysis/make/menke2020.mk | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/reproduce/analysis/make/menke2020.mk b/reproduce/analysis/make/menke2020.mk index df87080..4dd9897 100644 --- a/reproduce/analysis/make/menke2020.mk +++ b/reproduce/analysis/make/menke2020.mk @@ -48,7 +48,8 @@ $(mk20tab3): $(indir)/menke-etal-2020.xlsx | $(mk20dir) echo "# Column 1: YEAR [counter, i16] Year of journal's publication." > $@.tmp echo "# Column 2: NUM_PAPERS [counter, i16] Number of studied papers in that journal." >> $@.tmp echo "# Column 3: NUM_ID_TOOLS [counter, i16] Number of software/tools that were identified." >> $@.tmp - awk 'NR>1{printf("%-6d%-5d%d\n", $$2, $$3, $$(NF-1)*$$NF)}' \ + echo "# Column 4: JOURNAL_NAME [string, str150] Name of journal." >> $@.tmp + awk 'NR>1{printf("%-10d%-10d%-10d %s\n", $$2, $$3, $$(NF-1)*$$NF, $$1)}' \ FPAT='([^,]+)|("[^"]+")' $(indir)/$$base.csv >> $@.tmp # Set the temporary file as the final target. This was done so if @@ -62,4 +63,16 @@ $(mk20tab3): $(indir)/menke-etal-2020.xlsx | $(mk20dir) # Main LaTeX macro file $(mtexdir)/menke2020.tex: $(mk20tab3) | $(mtexdir) - touch $@ + + # Count the total number of papers in their study. + v=$$(awk '!/^#/{c+=$$2} END{print c}' $(mk20tab3)) + echo "\newcommand{\menkenumpapers}{$$v}" > $@ + + # Count how many unique journals there were in the study. Note that + # the `31' comes because we put 10 characters for each numeric + # column and separated the last numeric column from the string + # column with a space. If the number of numeric columns change in + # the future, the `31' also has to change. + v=$$(awk 'BEGIN{FIELDWIDTHS="31 10000"} !/^#/{print $$2}' \ + $(mk20tab3) | uniq | wc -l) + echo "\newcommand{\menkenumjournals}{$$v}" >> $@ |