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

I have some 90000 keywords that I need to search on a huge multiple text files. I have implemented this functionality, but due to the huge number of keyword to be scanned the process takes a long time.
Currently I have implemented a for loop and scan each and every keyword on all the text files but this process was fine with small number of keywords. Now when my keywords grew this takes a huge time.

Can anyone provide some resolution to minimize the time required for this requirement
Posted

   
hi try this,


string StrValue_FD = "Hello hi Hi hello length and are you length hi.";

            var split = StrValue_FD.ToUpper().Split(' ');
            int length = split.Length;

            List<string> list = new List<string>();

            while (length > 0)
            {
                list.Add(split[length - 1]);
                length--;
            }

            var result = list.GroupBy(str => str).ToDictionary(str => str.Key, str => str.Count());</string></string>


you can try this example. In result you can get the each word number of times occured.
   

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