title: sed while loop text format
body: <p>i need to change some lines i another format using this while loop.</p>
  
  <pre><code>while IFS= read -r line; 
  do 
  var=$(echo "$line" | grep -oE "http://img[0-9].domain.xy/t/[0-9][0-9][0-9]/[0-9][0-9][0-9]/" | uniq);
  echo "$line" | sed -e 's|http://img[0-9].domain.xy/t/[0-9][0-9][0-9]/[0-9][0-9][0-9]/||g' -e "s|.*|&amp;"${var}"|g" &gt;&gt; newFile; 
  done &lt; file;
  </code></pre>
  
  <p>that changes this format</p>
  
  <pre><code>&lt;iframe  src="http://domain.xy/load.php?file=2259929" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;|http://img9.domain.xy/t/929/320/1_2259929.jpg;http://img9.domain.xy/t/929/320/2_2259929.jpg;http://img9.domain.xy/t/929/320/3_2259929.jpg;http://img9.domain.xy/t/929/320/4_2259929.jpg;http://img9.domain.xy/t/929/320/5_2259929.jpg;http://img9.domain.xy/t/929/320/6_2259929.jpg;http://img9.domain.xy/t/929/320/7_2259929.jpg;http://img9.domain.xy/t/929/320/8_2259929.jpg;http://img9.domain.xy/t/929/320/9_2259929.jpg;http://img9.domain.xy/t/929/320/10_2259929.jpg|13m5s
  </code></pre>
  
  <p>and gives me that output.</p>
  
  <pre><code> &lt;iframe  src="http://domain.xy/load.php?file=2259929" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;|1_2259929.jpg;2_2259929.jpg;3_2259929.jpg;4_2259929.jpg;5_2259929.jpg;6_2259929.jpg;7_2259929.jpg;8_2259929.jpg;9_2259929.jpg;10_2259929.jpg|13m5s|http://img9.domain.xy/t/929/320/
  </code></pre>
  
  <p>that all works correct!!!</p>
  
  <p>but there is also a time value that i want to change. 13m5s to 00:13:5 or better else 13m5s to 00:13:05</p>
  
  <p>i try to use another grep + sed command at the end of the loop.</p>
  
  <pre><code>while IFS= read -r line; 
  do 
  var=$(echo "$line" | grep -oE "http://img[0-9].domain.xy/t/[0-9][0-9][0-9]/[0-9][0-9][0-9]/" | uniq);
  echo "$line" | sed -e 's|http://img[0-9].domain.xy/t/[0-9][0-9][0-9]/[0-9][0-9][0-9]/||g' -e "s|.*|&amp;"${var}"|g" &gt;&gt; newFile; 
  done &lt; file;
  grep -oE "[0-9]*m[0-9]*[0-9]s" newFile | sed -e 's|^|00:|' -e s'|m|:|' -e s'|s||'
  </code></pre>
  
  <p>this gives me only the output of the numbers not the full line.</p>
  
  <p>00:13:5<br>
  00:3:18<br>
  00:1:50<br></p>
  
  <p>and so on</p>
  
  <p>how can i get the full line and just change 13m5s to 00:13:5 ?</p>
  
  <p>if just use sed after the while loop without grep it changes the wrong letters. and puts 00: at the begin of every line.</p>
  
  <p>what is the best way to handle that. i think its be the best to integrate the command in the existing loop. but i have try many differnt variations witout a result.</p>
  
  <p>thx for helping</p>
  
  <p>thx</p>