Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Searching files

Expand Messages
  • Donato Azevedo
    If you are using active states distribution of perl, it comes with a binary for a SEARCH program which is good.. so you can call it in your program and parse
    Message 1 of 4 , May 3, 2005
    • 0 Attachment
      If you are using active states distribution of perl, it comes with a
      binary for a SEARCH program which is good.. so you can call it in your
      program and parse the results...

      or, you can use File::Find which also comes built in activestate's
      perl... so check out the docs for file::find for examples of use....



      I am begining to think I am the only one that does not use unix around
      here.............

      On 5/2/05, b2174ml <b2174ml@...> wrote:
      > How can I search the contents of all the files in a directory for a
      > specific phrase and write all of the filenames to an array which have
      > that phrase? I'm sort of looking for something like unix's grep
      > command, but in PERL. I don't want to have to open each file and read
      > each line within.
      >
      > Thanks
      > Mike
      >
      > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
      > Yahoo! Groups Links
      >
      >
      >
      >
      >


      --
      *******************************************
      Donato Azevedo
      Engenharia de Controle e Automação
      UFMG
      *******************************************
      We will encourage you to develop the three great virtues
      of a programmer: laziness, impatience, and hubris.
      "Larry Wall - Programming perl"
    • Mike Southern
      You *could* use perls grep command ... ... You have to open each file; you d always have to do that - but there s no need to read each line if all you want is
      Message 2 of 4 , May 3, 2005
      • 0 Attachment
        You *could* use perls grep command ...

        ... You have to open each file; you'd always have to do that - but there's
        no need to read each line if all you want is confirmation that the file
        contains the phrase.

        On 5/3/05 9:35 AM, Donato Azevedo at donatoaz@... wrote:

        > On 5/2/05, b2174ml <b2174ml@...> wrote:
        >> How can I search the contents of all the files in a directory for a
        >> specific phrase and write all of the filenames to an array which have
        >> that phrase? I'm sort of looking for something like unix's grep
        >> command, but in PERL. I don't want to have to open each file and read
        >> each line within.
      Your message has been successfully submitted and would be delivered to recipients shortly.