title: change values while reading a file / shell scripting loops ,
body: <p>I have a log file that looks like this,</p>
  <pre><code>&lt;tr&gt;&lt;td&gt;AAA-application-01 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;AAA-application-02 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;BBB-application-03 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;BBB-application-04 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr&gt;&lt;td&gt;CCC-application-01 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;  
  &lt;tr&gt;&lt;td&gt;CCC-application-02 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;  
  &lt;tr&gt;&lt;td&gt;CCC-application-03 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;  
  </code></pre>
  <p>I am looping through this log file and generating a HTML report as a table. &quot;AAA&quot; , &quot;BBB&quot; , &quot;CCC&quot; and &quot;DDD&quot; are the application groups.
  Here is the loop that I used there,</p>
  <pre><code>while read line; do
  for item in $line; do 
       echo $item
  done
  done &lt; filename.log 
  </code></pre>
  <p>But when the table is created in the report the application groups cannot be identified seperately.
  I mean they all prints the same. I want to seperate the application groups as it can be visually identified seperately in the report.
  im going to use CSS or bootsrap styles, so its is better if I can change the class of  while rendering to the HTML.</p>
  <p>So the end result should be like,</p>
  <pre><code>&lt;tr class=&quot;red&quot;&gt;&lt;td&gt;AAA-application-01 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class=&quot;red&quot;&gt;&lt;td&gt;AAA-application-02 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class=&quot;green&quot;&gt;&lt;td&gt;BBB-application-03 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class=&quot;green&quot;&gt;&lt;td&gt;BBB-application-04 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt; 
  &lt;tr class=&quot;yellow&quot;&gt;&lt;td&gt;CCC-application-01 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;  
  &lt;tr class=&quot;yellow&quot;&gt;&lt;td&gt;CCC-application-02 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;  
  &lt;tr class=&quot;yellow&quot;&gt;&lt;td&gt;CCC-application-03 &lt;br&gt; Qality_gate_failed_reason:xxxxxxx &lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  <p>so this means &quot;AAA&quot; applications will be red
  &quot;BBB&quot; application will be green
  &quot;CCC&quot; applicattion will be yellow</p>
  <p>When creating the log file I cannot add HTML elements seperately to the application groups ,  because I use a one script to take all of those values to the log file.</p>
  <p>I tried this so much for a long time and still couldnt figure out how to do this.</p>
  <p>Any suggestion on doing this ??  is this approch is possible or impossible to do ??</p>