Click here to Skip to main content
14,732,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

How find words that have xyz anywhere in that file.

Ex. abxyzc. How to find this word.

I have tried
cat filename | grep '*xyz*' | wc -l

But it's showing 0.

Please help, very urgent
Updated 23-Nov-12 7:03am

I have not tested this, but give this a try:
grep -o -w '\<*xyz*\>' -f filename | wc -w
string stringToCheck = "text1";
string[] stringArray = { "text1", "testtest", "test1test2", "test2text1" };
foreach (string x in stringArray)
    if (x.Contains(stringToCheck))
        // Process...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900