title: I have a script that gives an output on the screen and puts that data in a logfile but i want that data in another format. How can i do this?
body: <p>I have this script that shows output on the screen every period of time and also saves it in a log.txt file. But i want the way it is saved in my log.txt file in a different way. </p>
  
  <p><strong>My script is this:</strong></p>
  
  <pre><code>  1 #!/bin/bash
    2
    3 while [ 1 ]
    4 do
    5 echo "Downloadspeed in Mbps:"
    6 speedtest-cli --simple | grep Download | awk '{print $2}' | tee -a log.txt
    7 echo "TIJD:"
    8 date "+%T" | tee -a log.txt
    9 echo "DATUM:"
   10 date "+%D" | tee -a log.txt
   11 echo ""
   12 sleep $1m
   13 done
  </code></pre>
  
  <p><strong>An example log.txt looks like this:</strong></p>
  
  <pre><code>46.91
  01:46:40
  12/28/18
  41.84
  01:48:04
  12/28/18
  43.65
  01:49:25
  12/28/18
  </code></pre>
  
  <p><strong>But i want it to look like this:</strong></p>
  
  <pre><code>12/28/18 01:46:40 ,46.91            
  12/28/18 01:48:04 ,41.84        
  12/28/18 01:49:25 ,43.65
  </code></pre>
  
  <p>Can someone help me rewrite my script to get the other format in my log.txt file?</p>
  
  <p>Greetings</p>
  
  <p>Thomas Van Haute</p>