Hello,
I have an .html file that is generated from a reporting tool I use. I am writing a bash script that does various things and one of them is to grab the certain values from the .html report.
There is a lot of html code in the file (/tmp/report.html), but I want to zero in on this part:
Code:
<tr>
<th class="group" align="right">Total</th>
<td class="numeric bold">50</td>
<td class="numeric bold">25</td>
<td class="numeric bold">0</td>
<td class="numeric bold">50.0</td>
<td class="numeric bold">75.0</td>
<td class="numeric bold">70%</td>
</tr>
I want to grab just the 50, 25, 0, 50.0, 75.0, and 70% (lined up vertically in the output if all possible)
When I run this command string:
Code:
grep -A1 "Total" /tmp/report.html | awk `{print $3}
I get this output:
Code:
align="right">Total</th>
bold">50</td>
bold">25</td>
bold">0</td>
bold">50.0</td>
bold">75.0</td>
bold">70%</td>
As you can see, the word "Total" is the first and only time it is used in the html code, so I was thinking that would be where I would start. The numeric values will change from report to report, so I can't start with the "50" value, per se. I also tried following some of the examples from this thread, but to no avail.
viewtopic.php?f=21&t=1319Sorry, I am not well versed in using sed and awk, so any help would be great!