Search Results

Search: Posts Made By: arunshankar.c
1,366
Posted By birei
Hi arunshankar.c, Try: $ awk '$0 ~...
Hi arunshankar.c,

Try:

$ awk '$0 ~ /Kitnb\/ICCID1\/ICCID2\/IMSI1\/IMSI2\/MSISDN1\/MSISDN2\/VOUCHER1\/VOUCHER2/ { print FNR }' infile
44
Regards,
Birei
22,157
Posted By ctsgnb
If the 4rth column of your (coma separated) file...
If the 4rth column of your (coma separated) file is equal to 5 then the line number is printed:

awk -F, '$4==5 {print NR}' yourfile
22,157
Posted By ahamed101
You are almost there... Try this... awk...
You are almost there...
Try this...

awk -F, '/5/ {if ($4=="5") print FNR}' abc.txt
--ahamed
2,123
Posted By CarloM
I only added FNR, the rest is your original code...
I only added FNR, the rest is your original code - which you said 'performs the operation', so I assumed it was correct :p.

EDIT: Shouldn't !(a[$1,$2,$3,$4]) be !(a[$1,$3,$6,$7)?

EDIT2: Minor...
2,123
Posted By CarloM
Can't you just add FNR to your output? awk...
Can't you just add FNR to your output?

awk -F',' -v file1="$1" -v file2="$2" 'NR == FNR {a[$1,$2,$3,$4]++;next} !(a[$1,$2,$3,$4]) {print FNR OFS $0}' OFS="," file1.txt file2.txt
Showing results 1 to 5 of 5

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