Search Results

Search: Posts Made By: visakhcr
4,421
Posted By visakhcr
Thanks for the replies...I got over it by...
Thanks for the replies...I got over it by declaring a counter. Since I have to do it for a big file, the way with the counter is working pretty well...thanks for the replies..
4,421
Posted By visakhcr
sorry...i don't get this.... what I think...
sorry...i don't get this....

what I think this will do is that if(either of the expressions are present), then set to Y; else set to N.

What I need is if (all expressions are present), then set...
4,421
Posted By visakhcr
Hi.. isn't this an OR condition? What I need...
Hi..

isn't this an OR condition? What I need is that if all the expressions, AB, BC, CD and DE should be present in the file, then it should set flag as 'Y'
4,421
Posted By visakhcr
Check for more than one expression using AWK
I have a txt file like below:

testin.txt

AB
BC
CD
DE

I have the following awk script

BEGIN {flag1="N"}
/(AB)|(BC)|(CD)|(DE)/ {flag1="Y"}
END {print flag1}

>awk -f testin.awk...
Showing results 1 to 4 of 4

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