Skip to content

Commit

Permalink
add_data: Fix erroneous CSV generated by merge_csv
Browse files Browse the repository at this point in the history
Remove RUN from the awk command, as RUN with '>' ended up prepending
LOG() output into the first line of the merged CSV file.

Special thanks to Drew Rotheram (@drotheram) for catching this!
See reviews at #105 for more information.
  • Loading branch information
anthonyfok committed Jun 14, 2021
1 parent dba0cd0 commit 85f5e27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/add_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ merge_csv() {

# The "awk" magic that merge CSV files while stripping duplicated headers.
# See https://apple.stackexchange.com/questions/80611/merging-multiple-csv-files-without-merging-the-header
RUN awk '(NR == 1) || (FNR > 1)' "${input_files[@]}" > "$output_file"
# NOTE: DO NOT prepend RUN to the following awk command, as otherwise
# the log would be the first line in the merged CSV file!
# See reviews at #105 for more information.
awk '(NR == 1) || (FNR > 1)' "${input_files[@]}" > "$output_file"
}

############################################################################################
Expand Down

0 comments on commit 85f5e27

Please sign in to comment.