Search Results

Search: Posts Made By: danieladna
1,359
Posted By Corona688
Okay, that's doable: awk '(NR>1) && (X2>=$2)...
Okay, that's doable:

awk '(NR>1) && (X2>=$2) && ($3>=X1) { next }; { X1=$2; X2=$3 } 1' data

Which amounts to:

awk '
# If this isn't the first line, and it intersects the range X1-X2, skip...
1,637
Posted By Scott
It's an expression that would always evaluate to...
It's an expression that would always evaluate to "true" (as would 2 (but 0 would not)), thus performing the default "action", which in awk is to print the line. So, it's shorthand for { print }. I...
1,637
Posted By Scott
In awk: $ cat file Group1 Group2_3_1...
In awk:

$ cat file
Group1 Group2_3_1 1_2_3_4_5_

$ awk '{gsub("_", "", $3)}1' file
Group1 Group2_3_1 12345
3,442
Posted By Franklin52
awk '{for(i=2;i<=NF;i++) {if($i>=6)c++}} c>=5...
awk '{for(i=2;i<=NF;i++) {if($i>=6)c++}} c>=5 {print; c=0}' file


Explanation:
for(i=2;i<=NF;i++)

Loop through field 2 till the last field.

{if($i>=6)c++}}

If the value of the field is...
Showing results 1 to 4 of 4

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