Hi Experts,
Can you please advise , why I am not able to make it work, or why this is not working: I spent quite a lot of time on this figuring out , but not working,
file :
This is a test file thanks for your reply
This is another file again
Have a nice day this is a small file thanks again.
I am trying:
cat file|awk '{for(i=i;i<=NF;i++)if($i~"file") print $(i+1)}'
Output:
cat file|awk '{for(i=i;i<=NF;i++)if($i~"file") print $(i+1)}'
awk: Field $() is not correct.
The input line number is 1.
The source line number is 1.
The output should be :
thanks
again
thanks