Score:0

removing lines include values higher than the determined threshold

in flag

I have a data file such as:

data:

arht    -0.1006 0.0001  0.0147  100     arht    0.0012  -0.0002 0.0182  100
arht    -0.0006 1.0006  0.0133  100     arht    0.1011  0.0003  0.0175  100
bcmn     0.0005 0.0011  0.0165  100     bcmn    0.0015  0.0007  0.0197  100
ffgf    -0.0009 0.0012  0.0121  100     ffgf    0.0007  0.0010  0.0150  100
ffgf    -0.0004 0.0009  0.0105  100     ffgf    0.1008  0.0006  0.0151  100

I use the following command to extract the lines include the values higher than the absolute 0.10 for 2-3-4 and 7-8-9 columns:

awk 'sqrt($2*$2)<=.1 || sqrt($3*$3)>=.1 || sqrt($4*$4)>=.1 || sqrt($7*$7)>=.1 || sqrt($8*$8)>=.1 || sqrt($9*$9)>=.1 {print}' data > output

I need to remove these lines from the data file. How I can modify the above code?

Score:0
cn flag

Seems like a duplicate question Extracting the values greater than a threshold in text file? If so, you need to correct the first term of your code:

awk 'sqrt($2*$2)>=.1 || sqrt($3*$3)>=.1 || sqrt($4*$4)>=.1 || sqrt($7*$7)>=.1 || sqrt($8*$8)>=.1 || sqrt($9*$9)>=.1) {print}' data >output

Then all you have to do is to add a negate sign (!) in front to get what you want:

awk '!(sqrt($2*$2)>=.1 || sqrt($3*$3)>=.1 || sqrt($4*$4)>=.1 || sqrt($7*$7)>=.1 || sqrt($8*$8)>=.1 || sqrt($9*$9)>=.1) {print}' data > output
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.