Your requirement is not quite clear. For example, what do you mean by "add an identifying code"? Tom's answer suggests Search&Replace to include a code. Is that what you mean?
Here is a possible alternative but again, it is not quite clear what you have in mind:
Try EmEditor. It is a sophisticated text/code editor that allows you to search in one or more documents for a string and then
- extract the string (or the lines containing that string) into a separate document, or
- bookmark the lines and then manage the bookmarks (next, previous, clear, etc.) within the document.
You can then repeat the process for different strings, adding to the found results.
The program displays a count of the found strings - a sort-of pseudo frequency analysis. There is a free and a paid version.