Entering edit mode
12.0 years ago
RandManP
▴
10
Hi All, I would like to put "N" instead of those numbers which are less than 0.04 but keep 0. so:
0 0.1 9 0.004 98
23 2 89 0.002 9
0.001 0.03 45 9 10
awk '{for(i=1; i<=5; i++) {if ($i==0 || $i>0.04) print $i; else print "N"; }}' in.txt > out.txt
the output is correct but it will be printed in one column not in 5 columns like in.file. Thank you so much
Please indicate relevance of this question to a bioinformatics research problem.
I want to make a cutoff (RNA-seq data). Also it is only an example not real data. I want to know how I can manipulate the data
"print" always adds a new line by default
That is why you need to use printf here as I did in my following answer.