Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003

    Unanswered: Reading top N lines from a file in a given directory

    Hi All,

    I have a folder/directory where I have all my Oracle sql scripts, useful for development & db administration. Every script contains comments, documentation in the top 5 lines or so. Sometimes the comments start with /* and end with */ and sometimes the initial lines start with -- which means comments/remarks in Oracle.

    Now I want to write a perl/php script that will read all the files one-by-one from directory and pick the comments and write into a separate file so that I know what each script file does, without actually opening the script.

    Its like I want to create a single file which contains contents/index for all the script files. Can somebody help me writing this script ?

    Thanks in advance !

  2. #2
    Join Date
    Mar 2001
    Lexington, KY
    Since this is something we have as well, I thought I'd try and take a stab at it.

    Looking here:

    Althought it seems the {SQL}{MySQL} filter doesn't find /* */ comments correctly.

    So I would think the best bet would be to use {SQL} to find -- comments, then try using {C} to find C-style comments /* */.


  3. #3
    Join Date
    May 2003
    Sorry to say, but how do I use that ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts