aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis/make/format.mk
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/analysis/make/format.mk')
-rw-r--r--reproduce/analysis/make/format.mk44
1 files changed, 22 insertions, 22 deletions
diff --git a/reproduce/analysis/make/format.mk b/reproduce/analysis/make/format.mk
index fd4060a..979475f 100644
--- a/reproduce/analysis/make/format.mk
+++ b/reproduce/analysis/make/format.mk
@@ -6,7 +6,7 @@
# because it provides interesting statistics about tools and methods used
# in scientific papers.
#
-# Copyright (C) 2020-2021 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2020-2022 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
# This Makefile is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -28,13 +28,13 @@ mk20tab3 = $(a1dir)/table-3.txt
$(a1dir):; mkdir $@
$(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
- # Set a base-name for the table-3 data.
+# Set a base-name for the table-3 data.
base=$(basename $(notdir $<))-table-3
- # Unfortunately XLSX I/O only works when the input and output are
- # in the directory it is running. So first, we need to switch to
- # the input directory, run it, then put our desired output where we
- # want and delete the extra files.
+# Unfortunately XLSX I/O only works when the input and output are in
+# the directory it is running. So first, we need to switch to the
+# input directory, run it, then put our desired output where we want
+# and delete the extra files.
topdir=$$(pwd)
cd $(indir)
xlsxio_xlsx2csv $(notdir $<)
@@ -42,12 +42,12 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
rm $(notdir $<).*.csv
cd $$topdir
- # Read the necessary information. Note that we are dealing with a
- # CSV (comma-separated value) file. But when there are commas in a
- # string, quotation signs are put around it. The `FPAT' values is
- # fully described in the GNU AWK manual. In short, it ensures that
- # if there is a comma in the middle of double-quotes, it doesn't
- # count as a delimter.
+# Read the necessary information. Note that we are dealing with a CSV
+# (comma-separated value) file. But when there are commas in a
+# string, quotation signs are put around it. The `FPAT' values is
+# fully described in the GNU AWK manual. In short, it ensures that if
+# there is a comma in the middle of double-quotes, it doesn't count
+# as a delimter.
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_PAPERS_WITH_TOOLS [counter, i16] Number of papers with an identified tool." >> $@.tmp
@@ -56,9 +56,9 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
awk 'NR>1{printf("%-10d%-10d%-10d%-10d %s\n", $$2, $$3, $$3*$$NF, $$(NF-1), $$1)}' \
FPAT='([^,]+)|("[^"]+")' $(indir)/$$base.csv >> $@.tmp
- # Set the temporary file as the final target. This was done so if
- # there is any possible crash in the steps above, this rule is
- # re-run (its final target isn't rebuilt).
+# Set the temporary file as the final target. This was done so if
+# there is any possible crash in the steps above, this rule is re-run
+# (its final target isn't rebuilt).
mv $@.tmp $@
@@ -68,19 +68,19 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
# Main LaTeX macro file
$(mtexdir)/format.tex: $(mk20tab3)
- # Count the total number of papers in their study.
+# 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.
+# 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="41 10000"} !/^#/{print $$2}' \
$(mk20tab3) | uniq | wc -l)
echo "\newcommand{\menkenumjournals}{$$v}" >> $@
- # Count how many rows the original catalog has.
+# Count how many rows the original catalog has.
v=$$(awk '!/^#/{c++} END{print c}' $(mk20tab3))
echo "\newcommand{\menkenumorigrows}{$$v}" >> $@