Hello,
I have a list like this:
I want to know which label contains the pattern "33333", ie. I would like to have printed "B:".
I already tried following with awk:
It doesn't work..
Thanks for a hint/help in forward. If anyone has a simple solution in awk and or sed I would be very thankful.
Bye
Zaxxon
laters
zaxxon
I have a list like this:
Code:
A:
5432112 awdawd
89672235 egwegs
33597 sesefs
B:
8923746 efsqwf
33333 uh23dd
23666 uahwd3
C:
76432 afug23d
91222 iohiu2
237215 ih232893
D:
# and so on
I want to know which label contains the pattern "33333", ie. I would like to have printed "B:".
I already tried following with awk:
Code:
awk '
/^[A-Z]:/
{
label = $1
while ( NR != 1 )
{
if ( $1 == "33333" )
{
print label
break
}
else
{
getline
}
}
}
It doesn't work..
Thanks for a hint/help in forward. If anyone has a simple solution in awk and or sed I would be very thankful.
Bye
Zaxxon
laters
zaxxon