awk and _

Hi!
I need find only strings that contains _ but it lists all files. If I use double like __ then it shows strings which contains them but not if I use only one _

awk -F '|' '{AA=index($1,"_");if (AA) print $1 }' file.txt

I solved problem, string was too long I missed that it had already one more _ hiden in it while I was focusing on another part of it.

On Fri, 05 Sep 2014 23:06:02 +0000, Andy Crowd wrote:

> I solved problem, string was too long I missed that it had already one
> more _ hiden in it while I was focusing on another part of it.

Great, thanks for posting the follow-up explaining what the issue was -
perhaps it will help someone in the future. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C