Search Results

Search: Posts Made By: mehar
2,494
Posted By mehar
I tried in the following way {gsub("[\|]",...
I tried in the following way {gsub("[\|]", "NA")}{gsub("[()]", "")} and it gives as INTRONMODIFIERNANANANACTDP1NAprotein_codingNACODINGNAENSCAFT00000000012NA11

But it should keep NA only where...
2,494
Posted By mehar
Sorry if i have put some stupid questions. I have...
Sorry if i have put some stupid questions. I have tried doing that but couldn't find the logic as im novice in using awk.
2,494
Posted By mehar
Well!! I have tried that too, it still gives the...
Well!! I have tried that too, it still gives the same output.

---------- Post updated at 02:05 PM ---------- Previous update was at 01:59 PM ----------

Okay. Then could you help to do in the...
2,494
Posted By mehar
Thanks, i have the similar fix which is doing...
Thanks, i have the similar fix which is doing what i need. Here is the code.

awk 'BEGIN{OFS="\t"}{n=split ($8,TMP,";"); $8=""; for (i=1; i<=n; i++) if (match (TMP[i], /^DP=|^MQ=|^resource.EFF=/))...
6,577
Posted By mehar
In the initial question, 8th column is of type ...
In the initial question, 8th column is of type

chr1 602567 rs21953190 A G 5481.77 ....
2,494
Posted By mehar
This code is working only with first row. The...
This code is working only with first row. The second row remains the same. I want to replace the () and | in the 10th column in all the rows. i.e.
the data in the second row also should look like,
2,494
Posted By mehar
The previous solution gives the...
The previous solution



gives the output as



Here i want to split further

in first row into


similary the data in the second row

into


which means i want to replace...
2,494
Posted By mehar
Indeed the question looks similar, but the input...
Indeed the question looks similar, but the input format in the 8th column differs from the previous thread. To avoid confusion i have posted it as a new thread.
2,494
Posted By mehar
Modify text file using awk
I have text file with lines as shown here. Each row has 11 columns separated by tab. In each row, i want to split the 8th column such that the output should look like shown below. Here value in the...
6,577
Posted By mehar
I tried to put the code as a oneliner as shown...
I tried to put the code as a oneliner as shown below,
awk '{n = split ($8,TMP,";") $8 = "" for (i=1; i<=n; i++) if (match (TMP[i], /^DP=|^MQ=|^SNPEFF/)) {sub (/^.*=/,"",TMP[i]); $8 = $8...
6,577
Posted By mehar
Thanks it works. Could you explain the code if...
Thanks it works. Could you explain the code if possible?
6,577
Posted By mehar
Hi, Thanks it is working. But it is not...
Hi,

Thanks it is working. But it is not doing one thing. If you observe the output lines the 9th column is DP value and 10th is MQ value and then the values after SNPEFF_=.

Could you modify to...
6,577
Posted By mehar
Split column using awk in a text file
chr1 412573 . A C 2758.77 . ...
1,884
Posted By mehar
Join files based on column
Hi,

Thanks!! I found an alternate solution.


awk 'FNR==NR{a[$1]++;next}a[$1]' FileA FileB | awk -F '\t' 'BEGIN {OFS=FS} {print $0,"FIleA&FileB"}' > one.txt

awk...
1,884
Posted By mehar
Join two files
Hi,

I have two files Files, FileA and FileB which are attached.Each row in the files have 8 tab delimited columns. The two files have to be compared and joined based on first two columns. The...
2,678
Posted By mehar
Thanks!! it worked.
Thanks!! it worked.
2,678
Posted By mehar
AWK: Cannot read Number of records greater than 1(NR>1)
Hi all,

I have a tab-delimited text file of size 10Mb. I am trying to count the number of lines using,

grep -c . sample.txtor
wc -l < sample.txt or
awk 'END {print NR}' sample.txtAll these...
5,456
Posted By mehar
Hi, It worked and i too tried in the same...
Hi,

It worked and i too tried in the same way but, didn't put 1 in the end. What does it stand for?
5,456
Posted By mehar
AWK: calculate ratio of columns
Hi all,


I have a tab-delimited text file in which i have a few columns which look like,
X Y U V
2 3 4 5
4 5 3 4
6 4 3 2

For example, I want...
20,420
Posted By mehar
hii thanks !!!!!!!!! It worked but need a...
hii thanks !!!!!!!!!

It worked but need a little bit more help.

The awk code removes the alphabets [A-Z] in the 8th column and replaced with nothing. Could it be possible to keep those...
20,420
Posted By mehar
Please find the attached files. ...
Please find the attached files.


awktest.txt is the original file and test1.txt is the file which was generated by using the commands posted by you in which only the identifiers are removed and...
20,420
Posted By mehar
Thanks for your answer. I am sorry that i...
Thanks for your answer.

I am sorry that i was not clear with the question.

The file is a tab-delimited text file with 8 columns and the 8th column having the text ...
20,420
Posted By mehar
AWK:Split fields separated by semicolon
Hi all,


I have a .vcf file which contains 8 coulmns and the data under each column as shown below,
CHROM POS ID REF ALT QUAL FILTER INFO ...
Showing results 1 to 23 of 23

 
All times are GMT -4. The time now is 07:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy