Search Results

Search: Posts Made By: rajniman
1,058
Posted By kalpeer
Please try with below script #! /bin/bash...
Please try with below script


#! /bin/bash
while read line
do
in1=`echo $line | awk '{print $1}'`
in2=`echo $line | awk '{print $2}'`
ou1=`grep $in1 fileB | grep $in2`
if [ -z "$ou1" ];then...
1,803
Posted By ygemici
try this ;) # awk...
try this ;)
# awk 'NR==FNR{sub(/./,"",$1);if($1>2&&$1~/^[0-9]/)a[$0]=$1;next}{b[$0]++}
END{c=0;for(i in a){for(j in b){if(j~a[i])c++};;if(c==0){print i}c=0}
}' file1 file2
4 alwaysisng

regards...
1,803
Posted By guruprasadpr
awk 'NR==FNR{a[$0];next}$1>3{for (k in a){if (k ~...
awk 'NR==FNR{a[$0];next}$1>3{for (k in a){if (k ~ $2)next}print}' fileB fileA

Guru.
16,565
Posted By ctsgnb
You can redirect the output to a third file for...
You can redirect the output to a third file for example fileC:

awk 'NR==FNR{a[$0]++;next}a[$2] && $1>=3' fileB fileA >fileC
awk 'NR==FNR{a[$0];next}($2 in a)&& $1>=3' fileB fileA >fileC

If...
16,565
Posted By kalpeer
This also works grep -f fileB fileA | awk ' $1...
This also works
grep -f fileB fileA | awk ' $1 >= 3' > fileC
16,565
Posted By ahamed101
awk 'NR==FNR{a[$0]++;next}a[$2] && $1>=3' fileB...
awk 'NR==FNR{a[$0]++;next}a[$2] && $1>=3' fileB fileA
--ahamed
Showing results 1 to 6 of 6

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