Concatenate the output of a batch

Microsoft Windows xp professional w/sp2
October 7, 2010 at 13:30:06
Specs: Windows XP, dual/2
Hello,

I am new to batch scripting.Please help

I have a batch file "doit.bat" which calls another batch file and the final output is written into a text file.

Now as my 2nd file process multiple files and so I need all the output should be concatenated in a single file at the end.

--------doit.bat-----------------
for %%a IN (*.pcap) do call parser.bat %%a output.txt

----------parser.bat-------------
@ECHO OFF ECHO Processing: %1

"c:\Program Files\Wireshark\tshark.exe" -r %1 -R "ranap.misc==6" -T text -V > %2

I want that after processing all the *.pcap files, I get output text in single file.

Please help me as soon as possible.

Thanks !!


See More: Concatenate the output of a batch

Report •


#1
October 7, 2010 at 13:42:54
Replace:
"c:\Program Files\Wireshark\tshark.exe" -r %1 -R "ranap.misc==6" -T text -V > %2
With::
"c:\Program Files\Wireshark\tshark.exe" -r "%~1" -R "ranap.misc==6" -T text -V >> "%~2"

How To Ask Questions The Smart Way


Report •

#2
October 7, 2010 at 13:44:23
Assuming this command works:

"c:\Program Files\Wireshark\tshark.exe" -r %1 -R "ranap.misc==6" -T text -V > %2

change
> %2
to
>> %2


=====================================
Helping others achieve escape felicity

M2


Report •

#3
October 8, 2010 at 07:17:04
Thank you guys...

I tried 2nd solution and it worked simply....

Thanks


Report •
Related Solutions


Ask Question