Last active
December 28, 2019 04:13
-
-
Save sinarueeger/aedcdfd997e30df5941e5c529936f9c8 to your computer and use it in GitHub Desktop.
awk/sed cheatsheet
This file contains hidden or 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
## adding column N as last column to a file | |
FILE=~/gwas.txt | |
N=98 | |
awk '$NF="98"' $FILE > tmp-file | |
sed -e '1s/98/N/' tmp-file > tmp2-file |
This file contains hidden or 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
Chr SNP bp A1 A2 Freq b se p | |
1 1:2189996 2189996 A AGTTTT 0.257519 0.0301362 0.0449327 0.502414 | |
1 1:6713467 6713467 C A 0.642857 -0.0755824 0.0439458 0.0854506 | |
1 1:767213 767213 A G 0.148496 -0.026974 0.0593651 0.64956 | |
1 1:9059522 9059522 C T 0.174812 -0.012219 0.0548856 0.823826 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment