Last active
June 17, 2021 14:03
-
-
Save danielecook/b1b738d14ab4aa3d4fd36c1ee9dd3e92 to your computer and use it in GitHub Desktop.
get header from first file and drop it from other files #tsv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get header from first file and drop it from other files | |
awk 'NR == FNR || FNR > 1' *.tsv > ${output_file} | |
# Add a column for filename and filename column | |
awk -v OFS='\t' 'NR == FNR { print \$0, 'filename' } FNR > 1 { print \$0, FILENAME }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment