Dear friends,
Consider the following method that finds matching words in a file and writes them in another file.
Now, lets say the input file (is the file which i m scanning for matching words) has four occurrences of the word "Alice". The above method finds these four occurrences. What i would like to achieve now is how do i restrict the matched word writing into a file to only one time. What i mean is that the above method finds four occurrences of the word "Alice". Now i want the matched word Alice to be written only once in a file and also is there a way by which i could keep track of the counter. So that the output file should contain something like "Alice (found) 4 times..."
Any pointers or hints or suggestions are most welcome.
>
Consider the following method that finds matching words in a file and writes them in another file.
Now, lets say the input file (is the file which i m scanning for matching words) has four occurrences of the word "Alice". The above method finds these four occurrences. What i would like to achieve now is how do i restrict the matched word writing into a file to only one time. What i mean is that the above method finds four occurrences of the word "Alice". Now i want the matched word Alice to be written only once in a file and also is there a way by which i could keep track of the counter. So that the output file should contain something like "Alice (found) 4 times..."
Any pointers or hints or suggestions are most welcome.
>