in reply to Re^2: Parse for a name after a keyword search in all the files, given directory as input
in thread Parse for a name after a keyword search in all the files, given directory as input

So now we know in a little more detail what you want your script to do. Unfortunately you still have not said in what way it is going wrong.

Here then are a few suggestions.

  1. Read, understand and implement at least the first 2 steps of the Basic Debugging Checklist. Do this now, before anything else.
  2. Test to see if you are actually looping over all files in the directory. At the very least print a count of all the files you have tested by the end of the script.
  3. Test your regex (which we now know is wrong). A simple perlish grep will do: perl -ne '/^module / and print' somedir/filename.v and then modify the regex until it extracts what you want.
  4. If you still can't get the required output then post back here stating precisely in what way your code fails and providing an SSCCE

Happy debugging!

  • Comment on Re^3: Parse for a name after a keyword search in all the files, given directory as input
  • Download Code