Results 1 to 3 of 3

Thread: FIND command

  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FIND command

    Has Win98 been specifically designed to make me lose my mind?

    I thought that for years I'd used the FIND command to locate text, redirect the text to a file, and then test for a zero-length result file by copying it to a second file.


    Now when I search (find) my Log.dat file for a text string, when the text string is not found I seem to be getting an inane filename with a series of hyphens.

    To make matters worse, I can smell the bacon burning while I type this .....


    <pre>C:Bat>find "20020224" log.dat

    ---------- log.dat

    C:Bat>find /?
    Searches for a text string in a file or files.

    FIND [/V] [/C] [/N] [/i] "string" [[drive:][path]filename[ ...]]

    /V Displays all lines NOT containing the specified string.
    /C Displays only the count of lines containing the string.
    /N Displays line numbers with the displayed lines.
    /I Ignores the case of characters when searching for the string.
    "string" Specifies the text string to find.
    [drive:][path]filename
    Specifies a file or files to search.

    If a pathname is not specified, FIND searches the text typed at the prompt
    or piped from another command.

    C:Bat>find /c "20020224" log.dat

    ---------- log.dat: 0

    C:Bat>
    </pre>


  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FIND command

    Yes.

    Check for another log.dat anywhere on your system.

    Turn the heat down.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FIND command

    > Check for another log.dat anywhere on your system.

    Why? I have a slew of them, I know, maybe one for each project. It's only the log.dat in the current directory I'm interested in.

    I gather that you are telling me it is true, that FIND now will not create an empty file if no text is found, so the old trick of :
    <pre>copy file1+file1 file2
    if exist file2 (then file1 was not empty)
    </pre>

    will no longer work.


    >Turn the heat down.

    They don't call me "Crisptofer" for nothing, you know!

Posting Permissions

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