How to append an output to existing file with DOS and IPerf

Member_2_7966113
Member_2_7966113 used Ask the Experts™
on
Hello Experts,

In the attached batch file I would like to run the three iperf commands:

C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 1M > iperf-3.csv
C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 2M > iperf-3.csv
C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 3M > iperf-3.csv

You will notice that the first iperf commands runs with 1M bandwidth, the second runs with 2M and the third runs with 3M. They all write to a file called iperf-3.csv.

The problem is when I run all three commands in a batch file only the last output from the, C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 3M > iperf-3.csv is included in the iperf3-.csv file.

Can someone show me how to configure the batch file so that all three outputs are included in the output file 'iperf-3.csv'.

Thank you

Regards
bandwidthtest.zip
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Just double up on the redirection symbol of the last two commands, which appends to an existing file instead of overwriting it:
C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 1M > iperf-3.csv
C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 2M >> iperf-3.csv
C:\Users\..\iperf-3.1.3-win32\iperf3 -c 192.168.1.129 -i 1 -t 60 -u -b 3M >> iperf-3.csv

Open in new window

Author

Commented:
Great. Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial