Hi all,
Can anyone help with my problem?
I have a script where I need to find
a) pattern1 in file x
b) get next line details
c) If substr != PMS_GEN then
d) if substr = PMS_DEL or substr = PMS_ADD printf
Here's what I have so far which works fine:
awk '/PATTERN1/ {
if ( $7 ~ "failed," )
{ search=$0
getline
array_get[1]=$0
search=search $0
if ( substr(array_get[1],1,17) !~ " PMS_GEN" )
if ( substr(search,35,41) ~ "PMS_DEL" )
{ printf substr(search,69,11) ": " substr(array_ge[1],11) "\n" }
else if ( substr(search,35,41) ~ "PMS_ADD" )
{ printf substr(search,66,11) ": " substr(array_get[1],11) "\n" }
}
The problem I have is that I now need to get a substr of "search", and find out which file in a specified path its found in. Everything I've tried so far fails.
Thanks in advance for any help.
Can anyone help with my problem?
I have a script where I need to find
a) pattern1 in file x
b) get next line details
c) If substr != PMS_GEN then
d) if substr = PMS_DEL or substr = PMS_ADD printf
Here's what I have so far which works fine:
awk '/PATTERN1/ {
if ( $7 ~ "failed," )
{ search=$0
getline
array_get[1]=$0
search=search $0
if ( substr(array_get[1],1,17) !~ " PMS_GEN" )
if ( substr(search,35,41) ~ "PMS_DEL" )
{ printf substr(search,69,11) ": " substr(array_ge[1],11) "\n" }
else if ( substr(search,35,41) ~ "PMS_ADD" )
{ printf substr(search,66,11) ": " substr(array_get[1],11) "\n" }
}
The problem I have is that I now need to get a substr of "search", and find out which file in a specified path its found in. Everything I've tried so far fails.
Thanks in advance for any help.