Pipe the output

Discussion in 'Microsoft Windows 2000 CMD Promt' started by Aliyah, Mar 4, 2004.

  1. Aliyah

    Aliyah Guest

    Hi guys,

    Need help. I have a list of files (post.txt) to be search
    in temporary.log. Any ideas how can I pipe the output or
    copied the output in the textfile. I created this
    batchfile but it didn't work. I think missed something
    please help.

    for /f "tokens=*" %%a in (e:\temp\post.txt) do findstr /i %
    %a e:\temp\temporary.log

    thanks in advance.
     
    Aliyah, Mar 4, 2004
    #1
    1. Advertisements

  2. if EXIST e:\temp\myoutput.txt del e:\temp\myoutput.txt
    for /f "tokens=*" %%a in (e:\temp\post.txt) do findstr /i %%a
    e:\temp\temporary.log >> e:\temp\myoutput.txt
     
    Paul R. Sadowski, Mar 4, 2004
    #2
    1. Advertisements

  3. No need to loop with for. Use the /G: option of findstr. This should be
    much faster and give a sorted result.

    findstr /G:e:\temp\post.txt e:\temptemporaray.log

    HTH
     
    Matthias Tacke, Mar 4, 2004
    #3
  4. Aliyah

    Aliyah Guest

    thanks all.
     
    Aliyah, Mar 5, 2004
    #4
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.