Re: Cannot find text in *.py files with Windows Explorer?

Discussion in 'Python' started by John Machin, Apr 4, 2009.

  1. John Machin

    John Machin Guest

    John Machin, Apr 4, 2009
    #1
    1. Advertising

  2. John Machin wrote:
    > On Apr 4, 3:21 pm, John Doe <> wrote:
    >> Anybody have a solution for Windows (XP) Explorer search not finding
    >> ordinary text in *.py files?
    >>

    >
    > Get a grep on yourself!
    >
    > http://gnuwin32.sourceforge.net/packages/grep.htm


    There's something even better:

    "ack -- better than grep, a power search tool for programmers"

    http://betterthangrep.com/

    -- Gerhard
     
    Gerhard Häring, Apr 5, 2009
    #2
    1. Advertising

  3. En Sun, 05 Apr 2009 16:36:05 -0300, Gerhard Häring <>
    escribió:
    > John Machin wrote:
    >> On Apr 4, 3:21 pm, John Doe <> wrote:
    >>> Anybody have a solution for Windows (XP) Explorer search not finding
    >>> ordinary text in *.py files?

    >>
    >> Get a grep on yourself!
    >> http://gnuwin32.sourceforge.net/packages/grep.htm

    >
    > There's something even better:
    > http://betterthangrep.com/


    Both have the same problem: they scan the "bytes contained in the file",
    not the "textual information available from the file".
    If you want to search for "año", grep won't find it if the file is stored
    in utf-8 and your terminal is latin1, or inside an HTML document written
    as a&ntilde;o, and may have some trouble if the file is in utf-16. In some
    cases, grep may not find any text inside a PDF document (when it's
    compressed).

    The standard Windows search, on the contrary, does not have those
    limitations: but you have to "tell" it how to extract textual info from
    unknown file sources; in this case, that .py files are plain text files.

    This KB article [1] explains how to do that for .py files, and this [2]
    the underlying technology.

    [1] http://support.microsoft.com/?kbid=309173
    [2] http://channel9.msdn.com/wiki/desktopsearchifilters/

    --
    Gabriel Genellina
     
    Gabriel Genellina, Apr 6, 2009
    #3
  4. En Sun, 05 Apr 2009 16:36:05 -0300, Gerhard Häring <>
    escribió:
    > John Machin wrote:
    >> On Apr 4, 3:21 pm, John Doe <> wrote:
    >>> Anybody have a solution for Windows (XP) Explorer search not finding
    >>> ordinary text in *.py files?

    >>
    >> Get a grep on yourself!
    >> http://gnuwin32.sourceforge.net/packages/grep.htm

    >
    > There's something even better:
    > http://betterthangrep.com/


    Both have the same problem: they scan the "bytes contained in the file",
    not the "textual information available from the file".
    If you want to search for "año", grep won't find it if the file is stored
    in utf-8 and your terminal is latin1, or inside an HTML document written
    as a&ntilde;o, and may have some trouble if the file is in utf-16. In some
    cases, grep may not find any text inside a PDF document (when it's
    compressed).

    The standard Windows search, on the contrary, does not have those
    limitations: but you have to "tell" it how to extract textual info from
    unknown file sources; in this case, that .py files are plain text files.

    This KB article [1] explains how to do that for .py files, and this [2]
    the underlying technology.

    [1] http://support.microsoft.com/?kbid=309173
    [2] http://channel9.msdn.com/wiki/desktopsearchifilters/

    --
    Gabriel Genellina
     
    Gabriel Genellina, Apr 6, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. NewTel
    Replies:
    2
    Views:
    498
    G. Whiz
    Feb 23, 2006
  2. Muhammad Hasan Javed
    Replies:
    2
    Views:
    2,524
    eldochem
    Jun 10, 2008
  3. Tim Golden
    Replies:
    2
    Views:
    298
    John Doe
    Apr 10, 2009
  4. Dave Angel
    Replies:
    6
    Views:
    468
    John Doe
    Apr 27, 2009
  5. Ed Hauptman
    Replies:
    7
    Views:
    1,074
    Ed Hauptman
    Aug 7, 2009
Loading...

Share This Page