Number of occurrences of "text" in file
Posted: Mon Oct 28, 2002 2:28 pm
Does anyone know how to obtain a count of the number of occurrences of a specific text string (eg. "EXEC SQL") in a file?
Better still, once the number of occurrences in known, does anyone know of a way of moving the cursor directly to (say) the 43rd occurrence in the file?
BACKGROUND: Supporting an application that uses generated Cobol programs. Subsequently, resultant source code is very large spagehetti code. 100k lines of source is typical with many much, much bigger. Diagnostic tool identifies that the "problem" happened with the nth occurence of given statement.
Better still, once the number of occurrences in known, does anyone know of a way of moving the cursor directly to (say) the 43rd occurrence in the file?
BACKGROUND: Supporting an application that uses generated Cobol programs. Subsequently, resultant source code is very large spagehetti code. 100k lines of source is typical with many much, much bigger. Diagnostic tool identifies that the "problem" happened with the nth occurence of given statement.