I want to append date and time before each line in a text log file in windows
I run iperf command in cmd in windows 10.
iperf.exe -c192.168.5.199 -u -t4 -i1 -f Kbytes -w1024k -b1024k >> client-log.txt
C:\iperf-2.0.9-win64\iperf-2.0.9-win64>iperf.exe -c192.168.5.199 -u -t4 -i1 -f Kbytes -w1024k -b1024k
------------------------------------------------------------
Client connecting to 192.168.5.199, UDP port 5001
Sending 1470 byte datagrams, IPG target: 11484.38 us (kalman adjust)
UDP buffer size: 1024 KByte
------------------------------------------------------------
[ 3] local 192.168.5.133 port 50929 connected with 192.168.5.199 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 1.0 sec 126 KBytes 126 KBytes/sec
[ 3] 1.0- 2.0 sec 125 KBytes 125 KBytes/sec
[ 3] 2.0- 3.0 sec 125 KBytes 125 KBytes/sec
......
......
......
......
......
......
Expected output
C:\iperf-2.0.9-win64\iperf-2.0.9-win64>iperf.exe -c192.168.5.199 -u -t4 -i1 -f Kbytes -w1024k -b1024k
------------------------------------------------------------
Client connecting to 192.168.5.199, UDP port 5001
Sending 1470 byte datagrams, IPG target: 11484.38 us (kalman adjust)
UDP buffer size: 1024 KByte
------------------------------------------------------------
Wed Jan 27 11:44:26 UTC 2021 [ 3] local 192.168.5.133 port 50929 connected with 192.168.5.199 port 5001
Wed Jan 27 11:44:26 UTC 2021 [ ID] Interval Transfer Bandwidth
Wed Jan 27 11:44:26 UTC 2021 [ 3] 0.0- 1.0 sec 126 KBytes 126 KBytes/sec
Wed Jan 27 11:44:26 UTC 2021 [ 3] 1.0- 2.0 sec 125 KBytes 125 KBytes/sec
Wed Jan 27 11:44:26 UTC 2021 [ 3] 2.0- 3.0 sec 125 KBytes 125 KBytes/sec
My efforts
C:\iperf-2.0.9-win64\iperf-2.0.9-win64>iperf.exe -c192.168.5.199 -u -t4 -i1 -f Kbytes -w1024k -b1024k | echo %DATE% %TIME% >> client-log.txt
but its not adding date before each line it prints.