Menu

GREP PROBLEMS

Help
sarambaram
2007-10-24
2012-07-26
  • sarambaram

    sarambaram - 2007-10-24

    Help neede, please.

    1. When i grep like this it is fine..

    C:\Program Files\GnuWin32\bin>grep -i -w -r "3201" "C:\Documents and Settings\ij
    agarce.AGBPULS-CRO\Desktop\test\input\rf071023.txt" > "C:\Documents and Settings
    \ijagarce.AGBPULS-CRO\Desktop\test\output\test.txt"

    output is: 12,20071023,020000,020004,5,126706,"ZAUVIJEK LJUBAV - AMERICKA DRAMA","3201",250.50

    1. BUT when i grep like this, with whole folder, it is not fine

    C:\Program Files\GnuWin32\bin>grep -i -w -r "3201" "C:\Documents and Settings\ij
    agarce.AGBPULS-CRO\Desktop\test\input\" > "C:\Documents and Settings
    \ijagarce.AGBPULS-CRO\Desktop\test\output\test.txt"

    output is: C:\Documents and Settings\ijagarce.AGBPULS-CRO\Desktop\test\input/rf071023.txt:12,20071023,020000,020004,5,126706,"ZAUVIJEK LJUBAV - AMERICKA DRAMA","3201",250.50

    i need to grep whole folder but output should be like in first one.

     
    • Kees Zeelenberg

      Kees Zeelenberg - 2007-10-24

      If I understand your question correctly, you want to omit the filename from the output. "grep --help" shows that the -h (--no-filename) option achieves this.

      PS. Questions regarding the ordinary (i.e. not related to the MS-Windows port) usage of programs are best asked on the program's mailing list, not on one of the Gnuwin32 forums. Moreover, nothing is so simple as "grep --help" or as reading the manuals.

       
MongoDB Logo MongoDB