10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
The awk below produces the current output, which will add +1 to $3. However, I am trying to add the length of the matching characters between $5 and $6 to $3. I have tried using sub as a variable to store the length but am not able to do so correctly. I added comments to each line and the... (4 Replies)
Discussion started by: cmccabe
4 Replies
2. Shell Programming and Scripting
In the awk I am trying to add :p.=? to the end of each $9 that matches the pattern NM_. The below executes andis close but I can not seem to figure out why the :p.=? repeats in the split as in the green in the current output. I have added comments as well. Thank you :).
file
... (4 Replies)
Discussion started by: cmccabe
4 Replies
3. Shell Programming and Scripting
In the tab-delimited input below I am trying to use awk to -10 from $2 and +10 to $3. Something like
awk -F'\t' -v OFS='\t' -v s=10 '{split($4,a,":"); print $1,$2-s,$3+s,a,$5,$6} | awk {split(a,b,"-"); print $1,$2-s,$3+s,b-s,b+s,$5,$6}' input
should do that. I also need to -10 from $4... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
Trying to use awk to add a . to $4. The input and output is tab-delimeted, but the awk seems to add a . in front of $5 and is space-delimeted. It seems close, but I am not able to produce the desired output. Thank you :).
file
chr1 948895 949015 chr1:948895-949015 ISG15
chr1 ... (1 Reply)
Discussion started by: cmccabe
1 Replies
5. Shell Programming and Scripting
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)
Discussion started by: cmccabe
4 Replies
6. Shell Programming and Scripting
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
Chr Start End Ref Alt Func.refGene PopFreqMax CLINSIG Classification
chr1 43395635 ... (5 Replies)
Discussion started by: cmccabe
5 Replies
7. Shell Programming and Scripting
In file1 field $18 is removed.... column header is "Otherinfo", then each line in file1 is used to search file2 for a match. When a match is found the last four strings in file2 are copied to file1.
Maybe:
cut -f1-17 file1 and then match each line to file2
file1
Chr Start End ... (6 Replies)
Discussion started by: cmccabe
6 Replies
8. Shell Programming and Scripting
Dear All,
I would like to add values of a field, if the lines match in a certain field. Then I would like to divide the sum though the number of lines that have a matched field. This is the Input:
Input:
Test1 5
Test1 10
Test2 2
Test2 5
Test2 13
Test3 4
Output:
Test1 7.5
Test1 7.5... (6 Replies)
Discussion started by: DerSeb
6 Replies
9. Shell Programming and Scripting
Hi Everyone,
a.txt
a b c 1 e e e e e
a b c 2 e e e e e
the output is
a b c 1 e e e e e
a 00b c 2 e e e e e
when 4th field = '2', then add '00' in the front of 2nd field value.
Thanks (9 Replies)
Discussion started by: jimmy_y
9 Replies
10. Shell Programming and Scripting
Hi there, I have a csv file with some columns comma sepated like this :
4502-17,PETER,ITA2,LEGUE,92,ME - HALF,23/05/10 15:00
4502-18,CARL,ITA2,LEGUE,96,ME - HALF,20/01/09 14:00
4502-19,OTTO,ITA2,LEGUE,97,ME - MARY,23/05/10 15:00
As you can see the column n. 7 is a timestamp column, I need... (23 Replies)
Discussion started by: capnino
23 Replies