The awk below does put in VUS in the 9th field but I can not seem to skip the header then add the VUS. I tried to incorporate NR >=2 and NR > 1 with no luck. Thank you .
input
Code:
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 43395635 C T exonic 0.12 Benign
chr1 43396414 43396414 G A exonic 0.14 Benign
chr1 172410967 172410967 G A exonic 0.66
chr1 172411496 172411496 A G exonic 1
chr2 51254901 51254901 G A exonic 0.48
chr2 51254914 51254914 C T exonic 0.0023
current output
Code:
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG VUS
chr1 43395635 43395635 C T exonic 0.12 Benign VUS
chr1 43396414 43396414 G A exonic 0.14 Benign VUS
chr1 172410967 172410967 G A exonic 0.66 VUS
chr1 172411496 172411496 A G exonic 1 VUS
chr2 51254901 51254901 G A exonic 0.48 VUS
chr2 51254914 51254914 C T exonic 0.0023 VUS
desired output
Code:
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 43395635 C T exonic 0.12 Benign VUS
chr1 43396414 43396414 G A exonic 0.14 Benign VUS
chr1 172410967 172410967 G A exonic 0.66 VUS
chr1 172411496 172411496 A G exonic 1 VUS
chr2 51254901 51254901 G A exonic 0.48 VUS
chr2 51254914 51254914 C T exonic 0.0023 VUS
awk
Code:
awk -v OFS='\t' '$9=$9"VUS"' input
Last edited by cmccabe; 08-01-2016 at 06:10 PM..
Reason: fixed format
Guys....
Got a scenario in which I need to skip parsing the header record while I do an awk.
Does awk has the flexibility to accomplish this?.
If so, how do we do this?.
Thanks !!!
-Anduzzi :) (2 Replies)
I have a file with millions of rows that I need to add a delimiter and a new field with a zero to the end of each row. (its too big to open and do a find and replace regex)
I'm looking for the next line '\n' and need to replace it with a Unit Separator (hex \037) 0 \n.
I've tried the... (2 Replies)
Dear all,
I have been trying to print an entire field, if the first line of the field is matching.
For example, my input looks something like this.
aaa ddd zzz
123 987 126
24 0.650 985
354 9864 0.32
0.333 4324 000
I am looking for a pattern,... (5 Replies)
Friends,
I need help with the following in UNIX.
Merge all csv files in one folder considering only 1 header row and ignoring header of all other files.
FYI - All files are in same format and contains same headers.
Thank you (4 Replies)
Hi! Is there a way to append column and row header to a file in awk script.
For example if I have
Jane F 39 manager
Carlos M 40 system administrator
Sam F 20 programmer
and I want it to be
# name gend age occup
1 Jane F 39 manager
2 Carlos M ... (4 Replies)
Hi,
I have an input like this
1 2 3 4
2 3 4 5
4 5 6 7
I would like to count the no. of columns and print a header with a prefix "Col".
I would also like to count the no. of rows and print as first column with each line number with a prefix "Row"
So, my output would be
... (2 Replies)
Greetings!
I have been trying to find out a way to take a CSV file with a large number of rows, and a very large number of columns (in the thousands) and convert the rows to a single column of data, where the first row is a header representing the attribute name and the subsequent series of... (3 Replies)
I am just trying to insert the word "Index" using awk. The below is close but seems to add the word at the end and I can not get the syntax correct to add from the beginning. Thank you :).
awk -F'\t' -v OFS='\t' '{ $-1=$-1 OFS "Index"}$1=$1' file
current output
Chr Start End ... (3 Replies)
I am trying to add a field header Inheritence in between $9 and $10 and default the value of each line to .. The below awk is close I think. Thanks :).
input
R_Index Chr Start End Ref Alt Func.IDP.refGene Gene.IDP.refGene ... (4 Replies)