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. "Aliyah" <> wrote in message
    news:3f5301c401cc$6e795ca0$...
    >
    > for /f "tokens=*" %%a in (e:\temp\post.txt) do findstr /i %
    > %a e:\temp\temporary.log


    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. "Aliyah" wrote:

    >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.


    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
    --
    Greetings
    Matthias________________________________________
    For help on nt commands enter in a cmd window:
    W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
     
    Matthias Tacke, Mar 4, 2004
    #3
  4. Aliyah

    Aliyah Guest

    thanks all.
    >-----Original Message-----
    >"Aliyah" wrote:
    >
    >>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.

    >
    >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
    >--
    >Greetings
    >Matthias________________________________________
    >For help on nt commands enter in a cmd window:
    >W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
    >.
    >
     
    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.